Get TelephonyManager.getSubscriberId() : Telephony « Core Class « Android






Get TelephonyManager.getSubscriberId()

   
import android.content.Context;
import android.telephony.TelephonyManager;

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

}

   
    
    
  








Related examples in the same category

1.NetworkDetector: uses android.telephony.TelephonyManager to obtain telephony parameters like network state, phone type and SIM state.
2.Phone Dialer
3.Returns the DeviceId according to the TelephonyManager.
4.Check Network Type with TelephonyManager