0 like 0 dislike
50 views
in S10 by Q&A Expert (11.0k points)

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
by Q&A Expert (11.0k points)
5: get imei

/**

 * important

 * need <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />

 * need android:sharedUserId="android.uid.system"

 * need System signature

 */

private void getIMEI() {

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

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

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

        for (int slot = 0; slot < tm .getPhoneCount(); slot++) {

            String imei = tm .getImei(slot);

            Log.e("IMEI", imei);}

    } else {

        String imei = telephonyManager.getDeviceId();

    }

}

Related questions

0 like 0 dislike
1 answer 97 views
0 like 0 dislike
2 answers 239 views
0 like 0 dislike
1 answer 197 views
asked in TPS530 by jason Q&A Expert (11.0k points)
0 like 0 dislike
1 answer 113 views
asked in UnCategory by Hofer Q&A Professional (5.3k points)
0 like 0 dislike
1 answer 59 views
0 like 0 dislike
1 answer 104 views
0 like 0 dislike
1 answer 53 views
asked in TPS570 by Elden Q&A Professional (5.4k points)
Welcome to Telpo Q&A,

If you have a technical question ,please ask here, in English.
.
If you have faulty devices need be repaired,please create a issue ticket.

Please inquiry your ticket.

Notice :If you have an urgent question or cannot register account of Q&A, you can contact the online support in below jivochat .

Categories

...