views:

668

answers:

1

I wonder if it's possible to access to the SIM card with an Android Application

A: 

You can get the IMEI like this (but is it what you want ?), just an exemple :

mTelephonyMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String imei = mTelephonyMgr.getDeviceId();

Likewise, you have

String getSimCountryIso() : Returns the ISO country code equivalent for the SIM provider's country code.

String getSimOperator() : Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM.

String getSimOperatorName() : Returns the Service Provider Name (SPN).

String getSimSerialNumber() : Returns the serial number of the SIM, if applicable.

int getSimState() : Returns a constant indicating the state of the device SIM card.

String getSubscriberId() : Returns the unique subscriber ID, for example, the IMSI for a GSM phone.

For more, take a look at this page

and don't forget to add the correct permission in the manifest (getDeviceId() => Requires Permission: READ_PHONE_STATE)

Hubert
IMEI is associated with the phone device, not the SIM card.
martin
But Can I send APDU command to the SIM Card to communicate with a javacard application?
Adrien