Hoi Il Jung
Hoi Il Jung

Reputation: 23

How can I get getNetworkOperatorName() with android 6.x

TelephonyManager tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);

if(tm != null)
    carrier = tm.getNetworkOperatorName();

I just want to get network operator name which is called 'carrier'. But always return "" with android 6 device. Is there any solution?

Upvotes: 0

Views: 1860

Answers (1)

Raman
Raman

Reputation: 454

//Here is snippet, hope it helps you!
TelephonyManager tManager = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);

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

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

Upvotes: 1

Related Questions