Example usage for android.content Context TELEPHONY_SERVICE

List of usage examples for android.content Context TELEPHONY_SERVICE

Introduction

In this page you can find the example usage for android.content Context TELEPHONY_SERVICE.

Prototype

String TELEPHONY_SERVICE

To view the source code for android.content Context TELEPHONY_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.telephony.TelephonyManager for handling management the telephony features of the device.

Usage

From source file:Main.java

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

From source file:Main.java

public static String getIMSI(Context context) {
    Object objTemp = context.getSystemService(Context.TELEPHONY_SERVICE);
    TelephonyManager phoneMgr;//  w w  w .j ava 2  s  .  c  o  m
    String imsi = "";
    if (objTemp != null && objTemp instanceof TelephonyManager) {
        phoneMgr = (TelephonyManager) objTemp;
        imsi = phoneMgr.getSubscriberId();
    }
    return imsi;
}

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static String getIntservicemer(Context context) {
    return ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getNetworkOperatorName();
}

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;/*from  w ww. j a  va 2s  .  c  om*/
}

From source file:Main.java

public static String getDeviceId(Context context) {
    String IMEI = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
    return IMEI;/* www  .ja  va 2 s  .c om*/
}

From source file:Main.java

public static String getIMSI(Context paramContext) {

    return ((TelephonyManager) paramContext.getSystemService(Context.TELEPHONY_SERVICE)).getSubscriberId();

}

From source file:Main.java

public static String getDeviceId(Context ctx) {
    TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);

    return tm.getDeviceId();
}

From source file:Main.java

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