Android get phone model, native phone number, SDK version and FIRMWARW 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); ]

2 // txtPhoneNumber is a edittext used to display the phone number

 


Note:



Depending on the security mechanism of Android, when using Telephonymanager, it must be in Androidmanifest.xml



Add <uses-permission android:name= "Read_phone_state"/> Otherwise the system license cannot be obtained.



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. useSDK_INT the easily get this as an integer.



and Frimware version number (System version number) Build.VERSION.RELEASE



string RELEASE he user-visible version string.


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.