androidデバイス固有IDの取得:imei TelephonyManager経由

737 ワード

//デバイス固有IDの取得:imei TelephonyManager経由
public static String getImei(Context context, String imei) {
   try {
      TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
      imei = telephonyManager.getDeviceId();
   } catch (Exception e) {
      Log.e(JPushUtil.class.getSimpleName(), e.getMessage());
   }
   return imei;
}