why emulator giving IMEI number 000000000000000
Asked Answered
S

3

9

I found many post regarding this but not properly given answer. My application needs IMEI number ,i did that but it is showing 000000000000000(15 zero's). it is working fine with device but i want it run properly on my emulator. i want some unique number except these zero. if any programitically solution here .post your answer's. i have to set this number instead of (15 zeros) "352373051009616"

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

String imei = telephonyManager.getDeviceId();

textDeviceID2.setText("Device id:-" +imei);

any possible solution (programitically as well as hardcoded)

Sekofski answered 3/7, 2012 at 4:2 Comment(6)
emulator doesnt have any IMEI number instead try Android_IDSedate
thanks for reply. but i need to set Android_ID,IMEI,IMSI these three in same application that's why i need to set IMEI(except zero)Sekofski
Can't you just do String imei = (telephonyManager.getDeviceId() == "000000000000000" ? "something_else" : telephonyManager.getDeviceId());?Ivonneivor
it is not working.(with emulator) showing "000000000000000"Sekofski
@Himanshusharma Generate 15 digit random number for that.Diapause
String androidId = android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);Hypophyge
E
1

That's what the emulator uses as the IMEI. If you really need or want to change it, you can open up the emulator executable with a hex editor and modify it as per http://codepainters.wordpress.com/2009/12/11/android-imei-number-and-the-emulator/

Ehrman answered 3/7, 2012 at 4:28 Comment(2)
HEX EDITOR NOT SHOWING +CGSN (dont know why)Sekofski
@Sekofski try emulator-{arm,mips,x86}.exe. the emulator.exe does not contains anything that have to do with real emulationCowherd
D
1

Hope this helps you. You can edit your emulator IMEI number and the instructions are very clear there.

Dereliction answered 3/7, 2012 at 4:31 Comment(0)
P
1

From version 27.2.9 android emulator has some IMEI number. (But it seems that it's still not unique)

That probably fixes your problem.

Pomiculture answered 16/5, 2018 at 7:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.