当前位置: 首页>>代码示例>>Java>>正文


Java Build.SUPPORTED_ABIS属性代码示例

本文整理汇总了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;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:19,代码来源:SoLoader.java

示例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;
}
 
开发者ID:hss01248,项目名称:TensorFlowAndroidDynamic,代码行数:25,代码来源:TfFileDownloader.java

示例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;

}
 
开发者ID:hss01248,项目名称:TensorFlowAndroidDynamic,代码行数:22,代码来源:TfFileDownloader.java

示例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());
}
 
开发者ID:didi,项目名称:VirtualAPK,代码行数:16,代码来源:MainActivity.java

示例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;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:25,代码来源:CrashConstants.java

示例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;
}
 
开发者ID:pre-dem,项目名称:pre-dem-android,代码行数:19,代码来源:AppBean.java

示例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);
}
 
开发者ID:humaniq,项目名称:humaniq-android,代码行数:16,代码来源:GreeterActivity.java

示例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];
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:CrashDetails.java

示例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};
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:11,代码来源:SupportedArchitectures.java

示例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;
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:10,代码来源:DeviceUtils.java

示例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);
    }
}
 
开发者ID:gstraube,项目名称:cythara,代码行数:12,代码来源:AndroidFFMPEGLocator.java

示例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;
}
 
开发者ID:paramsen,项目名称:torch-android-studio-template,代码行数:15,代码来源:JNIBridge.java

示例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;
}
 
开发者ID:imliujun,项目名称:LJFramework,代码行数:12,代码来源:CpuUtils.java

示例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;
}
 
开发者ID:LiangMaYong,项目名称:android-apkbox,代码行数:9,代码来源:ApkABI.java

示例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;
}
 
开发者ID:pedroSG94,项目名称:vlc-example-streamplayer,代码行数:7,代码来源:VLCUtil.java


注:本文中的android.os.Build.SUPPORTED_ABIS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。