mobile development - How to detect Network operators programmatically on Android? -
is possible identify attached mobile network , network operators programmatically on android? if possible please provide code samples
thank you.
try this,
// system telephony service reference telephonymanager tmanager = (telephonymanager) getbasecontext() .getsystemservice(context.telephony_service); // carrier name (network operator name) string carriername = tmanager.getnetworkoperatorname(); // phone model , manufacturer name string manufacturer = build.manufacturer; string model = build.model;
required permission:
<uses-permission android:name="android.permission.read_phone_state"/>
Comments
Post a Comment