List of usage examples for android.content Context TELEPHONY_SERVICE
String TELEPHONY_SERVICE
To view the source code for android.content Context TELEPHONY_SERVICE.
Click Source Link
From source file:Main.java
public static String getPhoneDeviceId(Context context) { TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); return telManager == null ? null : telManager.getDeviceId(); }
From source file:Main.java
public static String getIMSICode(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); return telephonyManager.getSubscriberId(); }
From source file:Main.java
public static String getIMEINumber(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); return telephonyManager.getDeviceId(); }
From source file:Main.java
public static String getMyPhoneNumber(Activity _act) { return ((TelephonyManager) _act.getSystemService(Context.TELEPHONY_SERVICE)).getLine1Number(); }
From source file:Main.java
public static boolean isInSystemCall(Context context) { TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (telManager == null) return false; return (telManager.getCallState() != TelephonyManager.CALL_STATE_IDLE); }
From source file:Main.java
public static int getNetworkType(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); return telephonyManager.getNetworkType(); }
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
public static String getPhoneNumber(Context context) { TelephonyManager phoneMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String tel = phoneMgr.getLine1Number(); if (tel != null) { tel = tel.replace("+86", "").trim(); }/*from w w w.j a va2 s . c o m*/ return tel; }
From source file:Main.java
public static String getPhoneIMEI(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); return telephonyManager.getDeviceId(); }
From source file:Main.java
public static String getPhoneIMEI(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String imei = telephonyManager.getDeviceId(); return imei;// w ww .ja v a 2s . com }