Android examples for android.telephony:TelephonyManager
get phone Subscriber Id
import android.content.Context; import android.telephony.TelephonyManager; public class Main { public static String getIMSI(Context context) { if (null == context) { return null; }/* w w w. java 2 s . c om*/ String imsi = null; try { TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); imsi = tm.getSubscriberId(); } catch (Exception e) { } return imsi; } }