Android开发平台中,可通过TelephonyManager 获取本机号码。
在如东等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站建设、成都做网站 网站设计制作按需规划网站,公司网站建设,企业网站建设,高端网站设计,全网营销推广,成都外贸网站制作,如东网站建设费用合理。
java代码:
- TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
- txtPhoneNumber.setText(phoneMgr.getLine1Number()); //txtPhoneNumber是一个EditText 用于显示手机号
注:根据Android的安全机制,在使用TelephonyManager时,必须在AndroidManifest.xml中添加
手机型号 Build.MODEL
java代码:
- private void loadPhoneStatus(){
- TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
- txtPhoneModel.setText(Build.MODEL); //手机型号
- txtPhoneNumber.setText(phoneMgr.getLine1Number());//本机电话号码
- txtSdkVersion.setText(Build.VERSION.SDK);//SDK版本号
- txtOsVersion.setText(Build.VERSION.RELEASE);//Firmware/OS 版本号
- }
事实上,Build能向我们提供包括 硬件厂商,硬件编号,序列号等很多信息 调用方法也都同上,很简单。
Java代码:
- String
- BOARD
- The name of the underlying board, like "goldfish".
- String
- BOOTLOADER
- The system bootloader version number.
- String
- BRAND
- The brand (e.g., carrier) the software is customized for, if any.
- String
- CPU_ABI
- The name of the instruction set (CPU type + ABI convention) of native code.
- String
- CPU_ABI2
- The name of the second instruction set (CPU type + ABI convention) of native code.
- String
- DEVICE
- The name of the industrial design.
- String
- DISPLAY
- A build ID string meant for displaying to the user
- String
- FINGERPRINT
- A string that uniquely identifies this build.
- String
- HARDWARE
- The name of the hardware (from the kernel command line or /proc).
- String
- HOST
- String
- ID
- Either a changelist number, or a label like "M4-rc20".
- String
- MANUFACTURER
- The manufacturer of the product/hardware.
- String
- MODEL
- The end-user-visible name for the end product.
- String
- PRODUCT
- The name of the overall product.
- String
- RADIO
- The radio firmware version number.
- String
- SERIAL
- A hardware serial number, if available.
- String
- TAGS
- Comma-separated tags describing the build, like "unsigned,debug".
- long
- TIME
- String
- TYPE
- The type of build, like "user" or "eng".
- String
- UNKNOWN
- Value used for when a build property is unknown.
- String
- USER
效果图:
【编辑推荐】
Android UI设计模式
Android开发之旅:Android架构
Android Phone 7界面设置小教程
Android系统手机隐藏代码大全曝光
Android Activity和Intent机制学习笔记
当前文章:Android中获取手机信息
分享URL:http://www.shufengxianlan.com/qtweb/news22/98872.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联