Android programming get phone model, native phone number, SDK version and firmware version number (i.e. system version number)

Source: Internet
Author: User

In Android development platform, you can get the native number via Telephonymanager.
Telephonymanager phonemgr= (Telephonymanager) This.getsystemservice (Context.telephony_service);
Txtphonenumber.settext (Phonemgr.getline1number ()); txtPhoneNumber is a edittext used to display the phone number
Note:
Depending on the security mechanism of Android, when using Telephonymanager, you must add <uses-permission android:name= "Read_phone_state" in Androidmanifest.xml "/> will not be able to obtain the system license.

Phone model Build.model
String MODEL The end-user-visible name for the end product.
SDK version Build.VERSION.SDK
String Sdk This constant is deprecated. Use the sdk_int to easily get the as an integer.
and Frimware version number (System version number) Build.VERSION.RELEASE
String RELEASEThe user-visible version string. such as: 2.1-update1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.