Android X86上的IMEI“未知”

时间:2018-10-23 14:00:23

标签: android mobile imei android-x86

我已经使用运行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();

在本机设置屏幕中,我注意到序列号不可用(请参见下面的屏幕截图) enter image description here

有人知道如何在Android X86中获取IMEI吗?

1 个答案:

答案 0 :(得分:0)

基于@TheWanderer答案,电话系统。getDeviceId()应该返回null。