//get IMEI碼
String IMEI = this.getSystemService(Context.TELEPHONY_SERVICE).getDeviceId();
String myIMSI =android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_IMSI);
//打印
System.out.println("IMEI:" + IMEI);
修改Manifest.xml中權限: