1. 程式人生 > >Android 獲取手機IMEI (串號) 手機唯一標識

Android 獲取手機IMEI (串號) 手機唯一標識

Context context = getWindow().getContext();        
TelephonyManager telephonemanage = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);              
  try        {     
   Toast.makeText(this, "MIEI碼:"+telephonemanage.getDeviceId(), 1000).show();      
  }catch(Exception e){     
   Log.i("error", e.getMessage());  
  }

新增許可權:<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>