You can use Telephony Manager to read android many of the phone properties, network, sim, data state details etc.
First of all, you have to add permission in android manifest file:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> int phoneType = telephonyManager.getPhoneType(); switch (phoneType) { case (TelephonyManager.PHONE_TYPE_CDMA): break; case (TelephonyManager.PHONE_TYPE_GSM) : break; case (TelephonyManager.PHONE_TYPE_NONE): break; default: break; } //Getting Device ID String deviceId = telephonyManager.getDeviceId(); // Getting software version( not sdk version ) String softwareVersion = telephonyManager.getDeviceSoftwareVersion(); // Get the phone’s number String phoneNumber = telephonyManager.getLine1Number(); // Getting connected network iso country code String networkCountry = telephonyManager.getNetworkCountryIso(); // Getting the connected network operator ID String networkOperatorId = telephonyManager.getNetworkOperator(); // Getting the connected network operator name String networkName = telephonyManager.getNetworkOperatorName(); |
Incoming search terms:
- android get device country code
- get device details android
- network operator id



