當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。