Some devices ie. Galaxy Tablet 10.1 can only send SMS, but cannot call. Some other devices like Asus Transformer don\'t even have SIM card.
How can I detect if devic
Here is what I make to check is SMS available.
public boolean isAvailable(Context context, Intent intent) {
final PackageManager mgr = context.getPackageManager();
List list = mgr.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;
}
which is taken from developer.android.com.
And create an Intent to check like this:
Uri smsToUri = Uri.parse("smsto:");
Intent intent = new Intent(Intent.ACTION_SENDTO, smsToUri);
if (isAvailable(intent)) {
// do whatever you like.
}