本文整理汇总了Java中android.os.Build.SUPPORTED_ABIS属性的典型用法代码示例。如果您正苦于以下问题:Java Build.SUPPORTED_ABIS属性的具体用法?Java Build.SUPPORTED_ABIS怎么用?Java Build.SUPPORTED_ABIS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.os.Build
的用法示例。
在下文中一共展示了Build.SUPPORTED_ABIS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: supportArmeabi
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static boolean supportArmeabi(){
if(Build.VERSION.SDK_INT>=21) {
String[] abis = Build.SUPPORTED_ABIS;
if (abis != null) {
for (String abi : abis) {
if (abi.equalsIgnoreCase("armeabi")) {
return true;
}
}
}
}else{
if(Build.CPU_ABI.contains("armeabi") || Build.CPU_ABI2.contains("armeabi")){
return true;
}
}
return false;
}
示例2: getFirstSupportedAbi
private static String getFirstSupportedAbi() {
String abi1 = "";
if (Build.VERSION.SDK_INT >= 21) {
String[] abis = Build.SUPPORTED_ABIS;
if (abis != null) {
String abistr = "";
//第一个是原生支持的,后面的是兼容模式.虽然是兼容,但手动加载时很多并不兼容.
abi1 = abis[0];
for (String abi : abis) {
abistr = abistr + abi+",";
}
if(showLog)
Log.e(TAG, "[copySo] supported api:" + abistr);
}
} else {
if(showLog)
Log.e(TAG, "[copySo] supported api:" + Build.CPU_ABI + "--- " + Build.CPU_ABI2);
if (!TextUtils.isEmpty(Build.CPU_ABI)) {
abi1 = Build.CPU_ABI;
} else if (!TextUtils.isEmpty(Build.CPU_ABI2)) {
abi1 = Build.CPU_ABI2;
}
}
return abi1;
}
示例3: getSupportedAbi
public static String getSupportedAbi(){
String abi1 = "";
if (Build.VERSION.SDK_INT >= 21) {
String[] abis = Build.SUPPORTED_ABIS;
if (abis != null) {
for (String abi : abis) {
Log.d(TAG, "[copySo] supported api:" + abi);
abi1 = abi;
}
}
}else {
Log.d(TAG, "[copySo] supported api:" + Build.CPU_ABI + "--- " + Build.CPU_ABI2);
if(!TextUtils.isEmpty(Build.CPU_ABI)){
abi1 = Build.CPU_ABI;
}else if(!TextUtils.isEmpty(Build.CPU_ABI2)){
abi1 = Build.CPU_ABI2;
}
}
return abi1;
}
示例4: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView textView = (TextView)findViewById(R.id.textView);
String cpuArch;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
cpuArch = Build.SUPPORTED_ABIS[0];
} else {
cpuArch = Build.CPU_ABI;
}
textView.setText(cpuArch);
Log.d("ryg", "onCreate cpu arch is "+ cpuArch);
this.loadPlugin(this);
Log.d("ryg", "onCreate classloader is "+ getClassLoader());
}
示例5: createSalt
/**
* Helper method to create a salt for the crash identifier.
*
* @param context the context to use. Usually your Activity object.
*/
@SuppressLint("InlinedApi")
@SuppressWarnings("deprecation")
private static String createSalt(Context context) {
String abiString;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
abiString = Build.SUPPORTED_ABIS[0];
} else {
abiString = Build.CPU_ABI;
}
String fingerprint = "HA" + (Build.BOARD.length() % 10) + (Build.BRAND.length() % 10) +
(abiString.length() % 10) + (Build.PRODUCT.length() % 10);
String serial = "";
try {
serial = android.os.Build.class.getField("SERIAL").get(null).toString();
} catch (Throwable t) {
}
return fingerprint + ":" + serial;
}
示例6: createSalt
@SuppressLint("InlinedApi")
@SuppressWarnings("deprecation")
private static String createSalt(Context context) {
String abiString;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
abiString = Build.SUPPORTED_ABIS[0];
} else {
abiString = Build.CPU_ABI;
}
String fingerprint = "HA" + (Build.BOARD.length() % 10) + (Build.BRAND.length() % 10) +
(abiString.length() % 10) + (Build.PRODUCT.length() % 10);
String serial = "";
try {
serial = Build.class.getField("SERIAL").get(null).toString();
} catch (Throwable t) {
}
return fingerprint + ":" + serial;
}
示例7: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_greeter);
attachOnClickView(R.id.buttonLogin);
attachOnClickView(R.id.buttonRegister);
String ABI = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
ABI = Build.SUPPORTED_ABIS[0];
} else {
ABI = Build.CPU_ABI;
}
Log.d("ABI", ABI);
}
示例8: getCpu
/**
* Returns the current device cpu.
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
static String getCpu() {
if(android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP )
return android.os.Build.CPU_ABI;
else
return Build.SUPPORTED_ABIS[0];
}
示例9: getAbis
/**
* The most preferred ABI is the first element in the list.
*/
@TargetApi(21)
@SuppressWarnings("deprecation")
public static String[] getAbis() {
if (Build.VERSION.SDK_INT >= 21) {
return Build.SUPPORTED_ABIS;
}
return new String[]{Build.CPU_ABI, Build.CPU_ABI2};
}
示例10: getSupportedABIS
public static String[] getSupportedABIS() {
String[] result = new String[]{"-"};
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
result = Build.SUPPORTED_ABIS;
}
if (result == null || result.length == 0) {
result = new String[]{"-"};
}
return result;
}
示例11: isCPUArchitectureSupported
private boolean isCPUArchitectureSupported(String alias) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
for (String supportedAlias : Build.SUPPORTED_ABIS) {
if (supportedAlias.equals(alias))
return true;
}
return false;
} else {
return Build.CPU_ABI.equals(alias);
}
}
示例12: isTorchSupported
/**
* Torch is only supported on ARM.
*/
public boolean isTorchSupported() {
String[] abis = Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP ? Build.SUPPORTED_ABIS : new String[]{Build.CPU_ABI};
boolean armSupport = false;
for (String abi : abis) {
if (abi.matches("armeabi-v7a|arm64-v8a")) {
armSupport = true;
break;
}
}
return armSupport;
}
示例13: getSupportedAbis
/**
* 获取手机支持的CPU架构
*/
public static String[] getSupportedAbis() {
String[] abis;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
abis = Build.SUPPORTED_ABIS;
} else {
abis = new String[] { Build.CPU_ABI, Build.CPU_ABI2 };
}
return abis;
}
示例14: getWithABIs
public static final String[] getWithABIs() {
String[] abis = new String[]{};
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
abis = Build.SUPPORTED_ABIS;
} else {
abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2};
}
return abis;
}
示例15: getABIList21
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static String[] getABIList21() {
final String[] abis = Build.SUPPORTED_ABIS;
if (abis == null || abis.length == 0)
return getABIList();
return abis;
}