Example usage for android.telephony TelephonyManager getSimSerialNumber

List of usage examples for android.telephony TelephonyManager getSimSerialNumber

Introduction

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

Prototype

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

Source Link

Document

Returns the serial number of the SIM, if applicable.

Usage

From source file:Main.java

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

From source file:Main.java

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

From source file:Main.java

public static String getIMEI(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

    return tm.getSimSerialNumber();
}

From source file:Main.java

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

From source file:Main.java

public static String getSIMSerial(Context ctx) {
    TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE);
    return tm.getSimSerialNumber();
}

From source file:Main.java

public static String getIMEI(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

    String imei = tm.getSimSerialNumber();
    return imei;//from  w w  w. jav a  2s . com
}

From source file:Main.java

public static String getSimNumber(Context context) {
    TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    return telephonyManager.getSimSerialNumber();
}

From source file:Main.java

static String getSerialNum(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    String simSerialNumber = tm.getSimSerialNumber();
    return simSerialNumber;
}

From source file:Main.java

public static String getSimSerialNumber(Context context) {
    String simSerialNumber = null;
    try {//from   ww w . j a v a 2  s  . c  o m
        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        simSerialNumber = tm.getSimSerialNumber();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return simSerialNumber;
}

From source file:Main.java

public static String getICCID(Context context) {
    String iccid = "";
    try {//from   w ww  .  j ava 2s .c  o m
        TelephonyManager phoneManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        iccid = phoneManager.getSimSerialNumber();
    } catch (Exception e) {
        Log.e(TAG, "getIMEI error!");
        iccid = "";
    }
    if (iccid == null) {
        iccid = "";
    }
    return iccid;
}