Loading... <p> <p>如果需要通过android SDK获取手机相关信息。需要通过如下方式获取:</p> <p><strong>TelephonyManager telephonyManager=(TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);</strong></p> <p><strong>String imei=telephonyManager.getDeviceId();</strong></p> <p>不过,光这么写,会有类似如何查看android产生的异常的报错,主要是因为android的权限需要打开,在AndroidManifest.xml文件中增加:</p> <p><strong><uses-permission android:name="android.permission.READ_PHONE_STATE" /></strong></p> <p>就可以拿到手机的imei号了。</p> <p>TelephonyManager还有其他方法可以调用,获取手机的其他信息。</p> <p><strong>比如获取手机号码,可以这样:</strong></p> <p><strong>telephonyManager.getLine1Number();</strong></p> <p>不过在g1手机上测试,使用移动全球通的sim卡,无法得到手机号码,是个空字符串。</p> <p><strong>获取手机的sim卡号:</strong></p> <p><strong>telephonyManager.getSimSerialNumber();</strong></p> <p>这个可以在上述环境下得到。</p> <p><strong>获取客户id,在gsm中是imsi号:</strong></p> <p><strong>telephonyManager.getSubscriberId();</strong></p> <p>这个也能在商户环境得到。</p> <div></div> </p> 相关文章 马云最新演讲全文2020-9-30 关于px、em、rem、rpx、upx的知识 【通俗版】宽带网络公司是如何进行网络计费的? 过来人劝你35岁之后不要轻易去卖保险(二) android平台获取手机IMSI、IMEI 、序列号和手机号的方法 Android TextView添加滚动条 Nexus 5 和 Flyme一起了 Android TextView换行问题 传魅族将于CES2014发布新机 凯立德导航C-Car版3.0(android版自适应分辨率) Last modification:July 8th, 2011 at 03:11 pm © 允许规范转载 Support 如果觉得我的文章对你有用,请随意赞赏 ×Close Appreciate the author Sweeping payments Pay by AliPay Pay by WeChat