Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect Network operators programmatically on Android?

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.

like image 979
R.Jay Avatar asked Dec 04 '22 03:12

R.Jay


1 Answers

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"/> 
like image 154
No_Rulz Avatar answered Jan 25 '23 23:01

No_Rulz