3

I Have created Android App. And Before Api 29 I was get Device IMEI Id. Now Api 29 my methods return null.

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

            if (tm.getDeviceId() != null) {
               String imei=tm.getDeviceId();
            }

Android Documentation says that new version you must use new permission. Permission is READ_PRIVILEGED_PHONE_STATE but When I send it is not show to users for choose

ActivityCompat.requestPermissions(this,   
                new String[]{"android.permission.READ_PRIVILEGED_PHONE_STATE"},
                PERMISSIONS_CODE );

not showing. How I pass this problem?

0 Answers0