當前位置: 首頁>>代碼示例>>Java>>正文


Java Build.CPU_ABI2屬性代碼示例

本文整理匯總了Java中android.os.Build.CPU_ABI2屬性的典型用法代碼示例。如果您正苦於以下問題:Java Build.CPU_ABI2屬性的具體用法?Java Build.CPU_ABI2怎麽用?Java Build.CPU_ABI2使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.os.Build的用法示例。


在下文中一共展示了Build.CPU_ABI2屬性的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCpuAbi

public static String getCpuAbi() {
    try {
        String abi1 = Build.CPU_ABI;
        String abi2 = Build.CPU_ABI2;
        if ((abi1 != null && abi1.contains("armeabi"))
                || (abi2 != null && abi2.contains("armeabi"))) {
            return "armeabi";
        } else if ((abi1 != null && abi1.contains("mips"))
                || (abi2 != null && abi2.contains("mips"))) {
            return "mips";
        } else if ((abi1 != null && abi1.contains("x86"))
                || (abi2 != null && abi2.contains("x86"))) {
            return "x86";
        } else {
            return "armeabi";
        }
    } catch (Exception e) {
        return "armeabi";
    }
}
 
開發者ID:l465659833,項目名稱:Bigbang,代碼行數:20,代碼來源:NativeHelper.java

示例2: writeMiniVPN

private static String writeMiniVPN(Context context) {
    String[] abis;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) abis = getSupportedABIsLollipop();
    else
        //noinspection deprecation
        abis = new String[]{Build.CPU_ABI, Build.CPU_ABI2};
    String nativeAPI = NativeUtils.getNativeAPI();
    if (!nativeAPI.equals(abis[0])) {
        VpnStatus.logWarning(R.string.abi_mismatch, Arrays.toString(abis), nativeAPI);
        abis = new String[]{nativeAPI};
    }
    for (String abi : abis) {
        File vpnExecutable = new File(context.getCacheDir(), getMiniVPNExecutableName() + "." + abi);
        if ((vpnExecutable.exists() && vpnExecutable.canExecute()) || writeMiniVPNBinary(context, abi, vpnExecutable)) {
            return vpnExecutable.getPath();
        }
    }
    return null;
}
 
開發者ID:akashdeepsingh9988,項目名稱:Cybernet-VPN,代碼行數:19,代碼來源:VPNLaunchHelper.java

示例3: 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

示例4: 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

示例5: 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

示例6: getDeviceDetails

public static String getDeviceDetails(Context context) {

        return "Device Information\n"
                + "\nDEVICE.ID : " + getDeviceId(context)
                + "\nUSER.ID : " + getUserIdentity(context)
                + "\nAPP.VERSION : " + getAppVersion(context)
                + "\nLAUNCHER.APP : " + getCurrentLauncherApp(context)
                + "\nTIMEZONE : " + timeZone()
                + "\nVERSION.RELEASE : " + Build.VERSION.RELEASE
                + "\nVERSION.INCREMENTAL : " + Build.VERSION.INCREMENTAL
                + "\nVERSION.SDK.NUMBER : " + Build.VERSION.SDK_INT
                + "\nBOARD : " + Build.BOARD
                + "\nBOOTLOADER : " + Build.BOOTLOADER
                + "\nBRAND : " + Build.BRAND
                + "\nCPU_ABI : " + Build.CPU_ABI
                + "\nCPU_ABI2 : " + Build.CPU_ABI2
                + "\nDISPLAY : " + Build.DISPLAY
                + "\nFINGERPRINT : " + Build.FINGERPRINT
                + "\nHARDWARE : " + Build.HARDWARE
                + "\nHOST : " + Build.HOST
                + "\nID : " + Build.ID
                + "\nMANUFACTURER : " + Build.MANUFACTURER
                + "\nMODEL : " + Build.MODEL
                + "\nPRODUCT : " + Build.PRODUCT
                + "\nSERIAL : " + Build.SERIAL
                + "\nTAGS : " + Build.TAGS
                + "\nTIME : " + Build.TIME
                + "\nTYPE : " + Build.TYPE
                + "\nUNKNOWN : " + Build.UNKNOWN
                + "\nUSER : " + Build.USER;
    }
 
開發者ID:MindorksOpenSource,項目名稱:CrashReporter,代碼行數:31,代碼來源:AppUtils.java

示例7: getSupportedArchitectures

@SuppressWarnings("deprecation")
public static Collection<String> getSupportedArchitectures() {
	List<String> abis = new ArrayList<>();
	if (Build.VERSION.SDK_INT >= 21) {
		abis.addAll(Arrays.asList(Build.SUPPORTED_ABIS));
	} else {
		abis.add(Build.CPU_ABI);
		if (Build.CPU_ABI2 != null) abis.add(Build.CPU_ABI2);
	}
	return abis;
}
 
開發者ID:rafjordao,項目名稱:Nird2,代碼行數:11,代碼來源:AndroidUtils.java

示例8: 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

示例9: getDeviceListing

/**
 *
 * @return all involved Build.* parameters and its values
 */
public static String getDeviceListing() {
    return "Build.PRODUCT: " + Build.PRODUCT + "\n" +
            "Build.MANUFACTURER: " + Build.MANUFACTURER + "\n" +
            "Build.BRAND: " + Build.BRAND + "\n" +
            "Build.DEVICE: " + Build.DEVICE + "\n" +
            "Build.MODEL: " + Build.MODEL + "\n" +
            "Build.HARDWARE: " + Build.HARDWARE + "\n" +
            "Build.FINGERPRINT: " + Build.FINGERPRINT + "\n" +
            "Build.CPU_ABI: " + Build.CPU_ABI + "\n" +
            "Build.CPU_ABI2: " + Build.CPU_ABI2 + "\n" +
            "Build.HOST: " + Build.HOST;
}
 
開發者ID:zhuangzaiku,項目名稱:AndroidCollection,代碼行數:16,代碼來源:EmulatorDetector.java

示例10: 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

示例11: getABIList

@SuppressWarnings("deprecation")
public static String[] getABIList() {
    final String[] abis = new String[2];
    abis[0] = Build.CPU_ABI;
    abis[1] = Build.CPU_ABI2;
    return abis;
}
 
開發者ID:pedroSG94,項目名稱:vlc-example-streamplayer,代碼行數:7,代碼來源:VLCUtil.java

示例12: getDeviceInfo

public String getDeviceInfo() {
    return "\n" +
            "Brand:" +
            Build.BRAND +
            "\n" +
            "Manufacturer:" +
            Build.MANUFACTURER +
            "\n" +
            "Product:" +
            Build.PRODUCT +
            "\n" +
            "Board:" +
            Build.BOARD +
            "\n" +
            "Bootloader:" +
            Build.BOOTLOADER +
            "\n" +
            "CPU_abi:" +
            Build.CPU_ABI +
            "\n" +
            "CPU_abi2:" +
            Build.CPU_ABI2 +
            "\n" +
            "DEVICE:" +
            Build.DEVICE +
            "\n" +
            "Display:" +
            Build.DISPLAY +
            "\n" +
            "Fingerprint:" +
            Build.FINGERPRINT +
            "\n" +
            "Hardware:" +
            Build.HARDWARE +
            "\n" +
            "Host:" +
            Build.HOST +
            "\n" +
            "ID:" +
            Build.ID +
            "\n" +
            "Model:" +
            Build.MODEL +
            "\n" +
            "Time:" +
            Build.TIME +
            "\n" +
            "Type:" +
            Build.TYPE +
            "\n" +
            "User:" +
            Build.USER +
            "\n" +
            "CodeName:" +
            Build.VERSION.CODENAME +
            "\n" +
            "Incremental:" +
            Build.VERSION.INCREMENTAL +
            "\n" +
            "Release:" +
            Build.VERSION.RELEASE +
            "\n" +
            "SDK:" +
            Build.VERSION.SDK_INT +
            "\n";
}
 
開發者ID:alphater,項目名稱:garras,代碼行數:66,代碼來源:BaseFragment.java

示例13: cpu

public static String cpu() {
    return Build.CPU_ABI + " " + Build.CPU_ABI2;
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:3,代碼來源:Device.java


注:本文中的android.os.Build.CPU_ABI2屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。