Skip to content Skip to sidebar Skip to footer

Get Phone Region Name Programmatically

I have to get phone no region (means from which region this no belongs) programmatically. I searched lot and didn't find anyway then I thought to get current location through netwo

Solution 1:

Try Telephony Service.

TelephonyManager telman=(TelephonyManager) getSystemService(TELEPHONY_SERVICE);

a lot of info can retrieve as,

telman.getNetworkOperatorName();
telman.getSimSerialNumber();
telman.getLine1Number();
telman.getSubscriberId();

etc.

There is a method, telman.getCellLocation(); . I didn't try it yet, may be you can try.

Solution 2:

The easiest way to get the name of the Current Network Operator to which the Android phone is currently connected is to get hold of the android.telephony.TelephonyManager and get it from there:

TelephonyManagertelephonyManager=((TelephonyManager) Context.getSystemService(Context.TELEPHONY_SERVICE));
StringoperatorName= telephonyManager.getNetworkOperatorName();

similarly the sim operator can be retrieved by using:

StringoperatorName= telephonyManager.getSimOperatorName();

Post a Comment for "Get Phone Region Name Programmatically"