Alex Rivera | Logout

How to find out whether a particular device has SIM Hardware support?

Asked 2012-08-17T07:51:31.370
8

I wanted to disable features related to CALL and SMS in my application based on whether SIM hardware is present or not. Now a beginners approach towards this will be checking the Phone type using :

if (telephonyManager1.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE)

If true then its supported.

Everything was fine until i came across Sony Tablet S which has a SIM support only for Data and Messaging. No voice support. So for this device i need to disable only CALL feature but continue with SMS support. Sony tablet returns TelephonyManager.PHONE_TYPE_NONE so i can`t use the above methods. Also ,

telephonyManager1.getSimState();

returns 1 i.e SIM_STATE_ABSENT which is also same in case of HTC FLYER which has no support for SIM hardware itself.

So is there any way in which i can come to know if SIM hardware is there(irrespective of SIM card inserted or not) ?

Edit
Report

1 Answer

0

Use

PackageManager pm = this.getPackageManager();
boolean hasTelephony=pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);

Edit:

Try using

TelephonyManager.getLine1Number()

If this returns null then you wont have telephony feature. Have not tried. give it a shot

answered 2012-08-17T09:51:14.260

Your Answer