Question

i try to write an app that manages volumes in android devices and I need to know that the device support SimCard or not, because if doesn't support, we don't have any Ringer or phone volume.

so it's important me to Retrieve this.

my question is, how can I Understand the device which my app installed on it, support SimCard or not?

thank you

Was it helpful?

Solution

You can use Device id too. See here How to get the device's IMEI/ESN programmatically in android?

AFAIK, wifi-only devices(Without any SIM support) will return null as id. You need to test it once though.

[EDIT] You can query packagemanager to see if the device has SIM support (or telephony support)

PackageManager pm = getPackageManager();
boolean deviceSupportsSIM= pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);

You can check PackageManager to see more constants that can help you identify if it's a GSM or a CDMA device, in case you need.

[/EDIT]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top