0
i am developing an app and needed to handle the Telephonymanager, however, every time I use it gives some problem. For example:
E/Mplugin: Unsupported class: com.mediatek.common.telephony.Ionlyownersimsupport
I tried to get the imei:
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if (ActivityCompat.checkSelfPermission(this, READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
return;
}
String imei = telephonyManager.getImei();
I tried to get the name of the operator:
TelephonyManager manager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String nomeOperadora = manager.getNetworkOperatorName();
printarImei.setText(nomeOperadora);
But it always gives some error, sometimes error of permission even granting the permission in Manifest.xml... Thank you already!! Thank you!
Possible duplicate of How to Discover Android Mobile Operator?
– user28595
Possible duplicate of How to Programmatically Recover Mobile IMEI?
– user28595