Access the SIM Card with an Android Application?

后端 未结 6 1381
情深已故
情深已故 2020-12-01 04:54

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

6条回答
  •  温柔的废话
    2020-12-01 05:38

    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)

提交回复
热议问题