我已经使用运行Android X86的Virtual Box创建了虚拟机。我从这里http://www.android-x86.org/releases/releasenote-8-1-rc2获得了.iso图像 我尝试运行我的apk,每次尝试从TelephyManger中获取IMEI时,都会发生NullPointerException。这是我的代码:
final TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = "" + tm.getDeviceId();
在本机设置屏幕中,我注意到序列号不可用(请参见下面的屏幕截图)
有人知道如何在Android X86中获取IMEI吗?
答案 0 :(得分:0)
基于@TheWanderer答案,电话系统。getDeviceId()应该返回null。