Android examples for Hardware:CPU Information
CPU support X86
//package com.book2s; import java.lang.reflect.Field; import android.os.Build; import android.text.TextUtils; public class Main { public static final String ABI_X86 = "x86"; public static boolean supportX86() { return supportABI(ABI_X86); }//from www .j a va2 s.co m public static boolean supportABI(String requestAbi) { String abi = get_CPU_ABI(); if (!TextUtils.isEmpty(abi) && abi.equalsIgnoreCase(requestAbi)) return true; String abi2 = get_CPU_ABI2(); if (!TextUtils.isEmpty(abi2) && abi.equalsIgnoreCase(requestAbi)) return true; return false; } public static final String get_CPU_ABI() { return Build.CPU_ABI; } public static final String get_CPU_ABI2() { try { Field field = Build.class.getDeclaredField("CPU_ABI2"); if (field == null) return null; Object fieldValue = field.get(null); if (field == null || !(fieldValue instanceof String)) { return null; } return (String) fieldValue; } catch (Exception e) { } return null; } }