How to check if an Android device is running on an Intel processor?

Is there any code in the Android SDK that allows me to check if the device is running on an Intel processor?

thanks.

+4
source share
5 answers

I think you should use Build.CPU_ABI and Build.CPU_ABI2 to somehow detect a running processor. Just take a look at the Build class, which gives:

Information about the current assembly extracted from the system properties.

+1
source

As far as I know, but the only time you really need to know the ISA processor, you need to run your own code. Thus, one way is to simply add a method to your native library that returns a different value for different ISAs (MIPS, ARM, x86). And you just need one JNI call to get the answer you need.

+1
source

Personally, I use it as a hack, but perhaps you may find it useful. The idea is to use a cat to analyze / proc / cpuinfo and look for GenuineIntel. I use it in one application.

As I said, it seems like a hack, maybe a more experienced Android developer can offer a better solution.

 private boolean isAnIntel() { String[] args = {"/system/bin/cat", "/proc/cpuinfo"}; cmd = new ProcessBuilder(args); Process process = cmd.start(); InputStream in = process.getInputStream(); byte[] re = new byte[1024]; while(in.read(re) != -1){ result = result + new String(re); } in.close(); return result.indexOf("GenuineIntel") > 0; } 
+1
source

Do not forget that Android is LINUX. All processor information is in the file "/ proc / cpuinfo" If the processor is Intel, then the vendor_id value in this file will be GenuineIntel. (vendor_id: GenuineIntel)

0
source

The Intel blog has an article https://software.intel.com/en-us/blogs/2014/12/16/how-to-identify-the-image-is-32-bit-or-64-bit-user -space , which they advise to use the ro.product.cpu.abi property or Build again, which changed the API from Android 5.0

 CPU_ABI CPU_ABI2 SUPPORTED_32_BIT_ABIS SUPPORTED_64_BIT_ABIS SUPPORTED_ABIS 
0
source

All Articles