Determine the phone model and CPU model

Source: Internet
Author: User

<span style= "FONT-SIZE:18PX;" > Judging phone model:</span>
<span style= "FONT-SIZE:18PX;" >private Boolean isunusualphone () {try {class<?> cl = class.forname ("android.os.SystemProperties"); Object Invoker = Cl.newinstance (); Method m = Cl.getmethod ("Get", new class[] {string.class,string.class}), Object result = M.invoke (Invoker, new object[] { "Gsm.version.baseband", "no Message"}); return ((String) result). Equals ("I9250xxlj1") | | Build.MODEL.equals ("MI 3");} catch (Exception e) {return true;}} </span>


Determine the phone CPU model:

<span style= "FONT-SIZE:18PX;" >//Android 2.3 for ARM v5 yanqingpublic boolean hascompatiblecpu () {//If already checked return cached resultstring C Pu_abi = Android.os.Build.CPU_ABI; String Cpu_abi2 = "None"; if (Android.os.Build.VERSION.SDK_INT >= build.version_codes. FROYO) {//cpu_abi2//since//2.2try {cpu_abi2 = (String) Android.os.Build.class.getDeclaredField ("Cpu_abi2"). Get (null );} catch (Exception e) {return false;}} if (Cpu_abi.equals ("armeabi-v7a") | | Cpu_abi2.equals ("armeabi-v7a")) {return true;} try {filereader FileReader = new FileReader ("/proc/cpuinfo"); BufferedReader br = new BufferedReader (FileReader); String Line;while (line = Br.readline ()) = null) {if (Line.contains ("ARMv7")) {return true;}} Filereader.close ();} catch (IOException ex) {ex.printstacktrace (); return false;} return false;} </span>


Determine the phone model and CPU model

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.