android 手机信息获取
来源:互联网 发布:飞凡网络 编辑:程序博客网 时间:2024/05/16 11:40
原文地址: http://www.cocos2dev.com/?p=208
今天要获取用户反馈意见,我默认将用户的手机号码上传了,结果发现并不是所有的手机能拿到本机号码。找了下发现原是用户的SIM卡没有写入本机号码导致的。
Android获取本机号码:
TelephonyManager phoneMgr = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
String phoneNum = phoneMgr.getLine1Number();
AndroidManifest.xml中添加权限:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
刚才也说了,手机号码不是所有的都能获取。只是有一部分可以拿到。这个是由于移动运营商没有把手机号码的数据写入到sim卡中。
手机型号 Build.MODEL
String MODEL The end-user-visible name for the end product.
sdk版本 Build.VERSION.SDK
String SDK This constant is deprecated. Use SDK_INT to easily get this as an integer.
frimware版本号(系统版本号) Build.VERSION.RELEASE
String RELEASE The user-visible version string.
获取手机的其他信息:
private void getPhoneStatus(){
Build中包括 硬件厂商,硬件编号,序列号等很多信息。调用方法也很简单,和上面类似的。
下面是Google提供的参考表:
StringBOARDThe name of the underlying board, like "goldfish". (底层董事会名称)StringBOOTLOADERThe system bootloader version number.StringBRANDThe brand (e.g., carrier) the software is customized for, if any.(定制的系统的商标)StringCPU_ABIThe name of the instruction set (CPU type + ABI convention) of native code.StringCPU_ABI2The name of the second instruction set (CPU type + ABI convention) of native code.StringDEVICEThe name of the industrial design.(工业设计者名称,同board)StringDISPLAYA build ID string meant for displaying to the user(显示给用户的 (版本号)ID+INCREMENTAL)StringFINGERPRINTA string that uniquely identifies this build.(手机唯一性标示,包含所有信息)StringHARDWAREThe name of the hardware (from the kernel command line or /proc).StringHOST(管理员名称)StringIDEither a changelist number, or a label like "M4-rc20".(like MIUI,即版本号前缀)StringMANUFACTURERThe manufacturer of the product/hardware.(手机厂商)StringMODELThe end-user-visible name for the end product. (手机型号)StringPRODUCTThe name of the overall product. (产品总体名称型号)StringRADIOThe radio firmware version number.StringSERIALA hardware serial number, if available.StringTAGSComma-separated tags describing the build, like "unsigned,debug".longTIME StringTYPEThe type of build, like "user" or "eng".StringUNKNOWNValue used for when a build property is unknown.StringUSER- Android 获取手机信息
- android 获取手机信息
- 获取android手机信息
- android 获取手机信息
- android获取手机信息
- android 获取手机信息
- 获取android手机信息
- android 手机信息获取
- Android获取手机信息
- android 获取手机信息
- android获取手机信息
- Android 获取手机信息
- Android 获取手机信息
- Android 获取手机信息
- 获取android手机信息
- Android 获取手机信息
- Android 获取手机信息
- 获取android手机信息
- 几种比较好的哈希方法
- Android 地图的地理编码与地理反编码
- 关于碧螺春的江湖之三 【苏州 碧螺春 营养成分 健康价值】
- IOS资源PNG解决黑色无法查看的问题
- 【P2P网络】BitTorrent的DHT协议(译自官方版本)
- android 手机信息获取
- 《Windows程序设计》读书笔记
- adnroid 地图服务 详解
- Linux查看进程的内存占用情况(Linux性能调优)
- c# 动态调用webservice
- linux ubuntu vnc4srver
- Android 百度地图初学
- Liferay6.1中service的定义规则文件
- 最简单的WIN7内核PE系统