Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if device is capable of calling and messaging

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 device can makes calls? And how can I detect if device can send SMS?

like image 793
Mikooos Avatar asked Sep 15 '11 11:09

Mikooos


1 Answers

Using this technic you can test all sorts of things too e.g. compass, is location available

    PackageManager pm = getBaseContext().getPackageManager();
    pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
like image 181
Saqib Razaq Avatar answered Sep 22 '22 03:09

Saqib Razaq