Get IMEI in GenyMotion emulator

痴心易碎 提交于 2019-12-08 11:33:35

问题


Hi I'm developing an android application an runed it on genymotion emulator , in this application i need the device IMEI but i always get a null value the same logic works with AVD emulator or android smartphone

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

with permission added to the manifest

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

回答1:


The .getdeviceID()

is not reliable and yes it returns null if its an emulator. i found a link that might help you. Like an alternative

Link 1

Link 2

Link 3




回答2:


Genymotion emulator doesn't have IMEI code as there was an IMEI code if it's a real phone. But you can still generate a fake code with some specific method.



来源:https://stackoverflow.com/questions/18408530/get-imei-in-genymotion-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!