获取IMEI在GenyMotion模拟器 [英] Get IMEI in GenyMotion emulator

查看:1146
本文介绍了获取IMEI在GenyMotion模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我开发一个Android应用程序的符文它genymotion模拟器,在这个应用程序,我需要设备的IMEI,但我总是得到一个空值同样的逻辑适用于AVD模拟器或Android智能手机

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

许可添加到清单

 <使用许可权的android:NAME =android.permission.READ_PHONE_STATE/>


解决方案

Genymotion模拟器没有IMEI code,因为有一个IMEI code,如果它是一个真正的手机。但你仍然可以生成一个假的code与一些特定的方法。

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" />

解决方案

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.

这篇关于获取IMEI在GenyMotion模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆