Android IMEI Get getIMEI(Context context)

Here you can find the source of getIMEI(Context context)

Description

get Imei

Parameter

Parameter Description
context a parameter

Return

imei

Declaration

public static String getIMEI(Context context) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.telephony.TelephonyManager;

public class Main {
    /**/*from   w  ww. j av a2s.co  m*/
     * get Imei
     * @param context 
     * @return imei
     * */
    public static String getIMEI(Context context) {
        try {
            TelephonyManager mTelephonyMgr = (TelephonyManager) context
                    .getSystemService(Context.TELEPHONY_SERVICE);
            String imei = mTelephonyMgr.getDeviceId();
            return imei;
        } catch (Exception e) {
        }
        return null;
    }
}

Related

  1. getIMEI(Context context)
  2. getIMEI(Context context)
  3. getIMEI(Context context)
  4. showInputMethodPicker(Context context)