How to detect if device is capable of calling and messaging

Mikooos picture Mikooos · Sep 15, 2011 · Viewed 9.5k times · Source

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?

Answer

Saqib Razaq picture Saqib Razaq · Sep 15, 2011

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);