1

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

Amir Hossein Ghasemi
  • 20,623
  • 10
  • 57
  • 53
  • 1
    see this answer http://stackoverflow.com/questions/15563893/how-to-check-phone-calling-service-is-enable-or-not-in-android-device – Sanket Kachhela Aug 14 '13 at 06:27
  • thank you, but it haven't any solution for that! i have a way but i'm not sure about that, and that is: if my operator name is null, it haven't simcard, but i just have one tablet and can't test it, all of devices without operator name, haven't simcard, and the emulator operator name is "Android" – Amir Hossein Ghasemi Aug 14 '13 at 06:35

1 Answers1

3

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]

Community
  • 1
  • 1
Aman Gautam
  • 3,549
  • 2
  • 21
  • 25