Example usage for android.telephony TelephonyManager getDeviceId

List of usage examples for android.telephony TelephonyManager getDeviceId

Introduction

In this page you can find the example usage for android.telephony TelephonyManager getDeviceId.

Prototype

@Deprecated
@SuppressAutoDoc 
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public String getDeviceId() 

Source Link

Document

Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones.

Usage

From source file:Main.java

public static String getIMEI(Context mContext) {
    TelephonyManager tel = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
    return tel.getDeviceId();
}

From source file:Main.java

public static String GetDeviceID(Context context) {
    TelephonyManager mngr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return mngr.getDeviceId();
}

From source file:Main.java

public static String getImei(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return tm.getDeviceId();
}

From source file:Main.java

public static String getIMEI(Context ctx) {
    TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
    String imei = tm.getDeviceId();
    return imei;/*  w  ww  . j ava 2 s. c  o m*/
}

From source file:Main.java

public static String getUUID(Context context) {
    TelephonyManager tManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return tManager.getDeviceId();
}

From source file:Main.java

public static final String getIMEI(final Context context) {
    TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return manager.getDeviceId();
}

From source file:Main.java

public static String getDeviceId(Context context) {
    TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return manager.getDeviceId();
}

From source file:Main.java

public static String getDeviceId(Context context) {
    TelephonyManager phoneMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return phoneMgr.getDeviceId();
}

From source file:Main.java

/**
 * Return the IMEI code/*from  w w w.ja va 2s  . c o  m*/
 *
 * @param context
 * @return
 */
public static String getImeiCode(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return tm.getDeviceId();
}

From source file:Main.java

public static String getDeviceUUID(Context context) {
    TelephonyManager tManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return tManager.getDeviceId();
}