<span style= "FONT-SIZE:18PX;" > Infer 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>
Infer 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>
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
Speculative phone models and CPU models