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


Java Build.CPU_ABI屬性代碼示例

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


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

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

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

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

private static String getHandSetInfo() {
    String handSetInfo = "手機型號:" + Build.MODEL
            + "\n係統版本:" + Build.VERSION.RELEASE
            + "\n產品型號:" + Build.PRODUCT
            + "\n版本顯示:" + Build.DISPLAY
            + "\n係統定製商:" + Build.BRAND
            + "\n設備參數:" + Build.DEVICE
            + "\n開發代號:" + Build.VERSION.CODENAME
            + "\nSDK版本號:" + Build.VERSION.SDK_INT
            + "\nCPU類型:" + Build.CPU_ABI
            + "\n硬件類型:" + Build.HARDWARE
            + "\n主機:" + Build.HOST
            + "\n生產ID:" + Build.ID
            + "\nROM製造商:" + Build.MANUFACTURER // 這行返回的是rom定製商的名稱
            ;
    Log.e("tt",handSetInfo);
    return handSetInfo;
}
 
開發者ID:hss01248,項目名稱:MainActivityUIUtil,代碼行數:18,代碼來源:StatusbarUtil.java

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

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

示例9: installBinary

private boolean installBinary(Context context){
	String binaryDirName = null;
	String abi = Build.CPU_ABI;
	if (abi.startsWith("armeabi-v7a")) {
		binaryDirName = "armeabi-v7a";
	}else if(abi.startsWith("x86")) {
		binaryDirName = "x86";
	}else{
		binaryDirName = "armeabi";
	}
	return install(context, BINARY_DEST_DIR_NAME, binaryDirName, BINARY_FILE_NAME);
}
 
開發者ID:paozhuanyinyu,項目名稱:FreshMember,代碼行數:12,代碼來源:DaemonStrategyUnder21.java

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

示例11: getValue

static Architecture getValue() {
    String arch = Build.CPU_ABI;
    if (TextUtils.isEmpty(arch)) {
        Fabric.getLogger().d(Fabric.TAG, "Architecture#getValue()::Build.CPU_ABI returned null or empty");
        return UNKNOWN;
    }
    Architecture value = (Architecture) matcher.get(arch.toLowerCase(Locale.US));
    if (value == null) {
        return UNKNOWN;
    }
    return value;
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:12,代碼來源:CommonUtils.java

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

示例13: init

private void init() {
    isRoot = RootUtil.isRoot();
    if (!isRoot) {
        tvRootStatus.setVisibility(View.VISIBLE);
        return;
    }

    scriptStorePath = this.getCacheDir().getAbsolutePath();
    ZipUtil.unzip(this.getPackageCodePath(), SCRIPT_NAME, scriptStorePath);
    String cmd = "chmod 777 " + scriptStorePath + File.separator + Build.CPU_ABI + File.separator + SCRIPT_NAME;
    RootUtil.execRootCmd(cmd);
}
 
開發者ID:gnaixx,項目名稱:dex-hdog,代碼行數:12,代碼來源:MainActivity.java

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

示例15: getCpuArch

public static CpuArch getCpuArch() {
    Log.d("Build.CPU_ABI : " + Build.CPU_ABI);

    switch (Build.CPU_ABI) {
        case X86_CPU:
        case X86_64_CPU:
            return CpuArch.x86;
        case ARM_64_CPU:
        case ARM_V7_CPU:
            return CpuArch.ARMv7;
        default:
            return CpuArch.NONE;
    }
}
 
開發者ID:bravobit,項目名稱:FFmpeg-Android,代碼行數:14,代碼來源:CpuArchHelper.java


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