SIM의 IMSI값 읽어오기

IMSI(International Mobile Subscriber identity)
  1. 전세계적으로 unique한 값(15~18 digits)

  2. MCC(Mobile Country Code) + MNC(Mobile Network Code) + MSIN으로 구성

방법1.


Eclair 버전의
BluetoothHandsfree.java 의  
        parser.register("+CIMI", new AtCommandHandler() {
            @Override
            public AtCommandResult handleActionCommand() {
                // AT+CIMI
                String imsi = mPhone.getSubscriberId();
                if (imsi == null || imsi.length() == 0) {
                    return reportCmeError(BluetoothCmeError.SIM_FAILURE);
                } else {
                    return new AtCommandResult(imsi);
                }
            }
        });

방법2.
String phoneIMSI =
android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_IMSI);

String phoneIMEI =
 android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_IMEI);
방법3.
 
TelephonyManager mTelephonyMgr =
                        (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
  String imsi = mTelephonyMgr.getSubscriberId();
  String imei = mTelephonyMgr.getDeviceId();
  String phoneNumber = mTelephonyMgr.getLine1Number();

'기술참고자료 > Android' 카테고리의 다른 글

<supports-screens> Guide  (1) 2011.04.19
<support-screen>  (0) 2011.04.19
단말정보 조회관련 정보  (0) 2011.04.19
Android Graphics Example - Bitmap Image  (1) 2011.04.16
Android Graphics Example  (0) 2011.04.15