How to detect Network operators programmatically on Android?

R.Jay picture R.Jay · Apr 29, 2015 · Viewed 9.2k times · Source

Is it possible to identify currently attached mobile network and network operators programmatically on Android? If it is possible please provide code samples

Thank you.

Answer

No_Rulz picture No_Rulz · Apr 29, 2015

Try this,

// Get System TELEPHONY service reference
TelephonyManager tManager = (TelephonyManager) getBaseContext()
      .getSystemService(Context.TELEPHONY_SERVICE);

// Get carrier name (Network Operator Name)
String carrierName = tManager.getNetworkOperatorName();

// Get Phone model and manufacturer name
 String manufacturer = Build.MANUFACTURER;
 String model = Build.MODEL;

Required Permission:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>