Example usage for android.os Build SUPPORTED_ABIS

List of usage examples for android.os Build SUPPORTED_ABIS

Introduction

In this page you can find the example usage for android.os Build SUPPORTED_ABIS.

Prototype

String[] SUPPORTED_ABIS

To view the source code for android.os Build SUPPORTED_ABIS.

Click Source Link

Document

An ordered list of ABIs supported by this device.

Usage

From source file:Main.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static String[] getSupportedAbisLollipop() {
    return Build.SUPPORTED_ABIS;
}

From source file:Main.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static String[] getSupportedABIsLollipop() {
    return Build.SUPPORTED_ABIS;
}

From source file:Main.java

public static String[] getSupportedABIS() {
    String[] result = new String[] { "-" };
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        result = Build.SUPPORTED_ABIS;
    }//from   w w  w  .j  av a  2 s  .  co  m
    if (result == null || result.length == 0) {
        result = new String[] { "-" };
    }
    return result;
}

From source file:Main.java

public static String getPsuedoUniqueID() {
    String devIDShort = "35" + (Build.BOARD.length() % 10) + (Build.BRAND.length() % 10);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        devIDShort += (Build.SUPPORTED_ABIS[0].length() % 10);
    } else {/*  ww  w. java2 s .  c  om*/
        devIDShort += (Build.CPU_ABI.length() % 10);
    }
    devIDShort += (Build.DEVICE.length() % 10) + (Build.MANUFACTURER.length() % 10)
            + (Build.MODEL.length() % 10) + (Build.PRODUCT.length() % 10);
    String serial;
    try {
        serial = Build.class.getField("SERIAL").get(null).toString();
        return new UUID(devIDShort.hashCode(), serial.hashCode()).toString();
    } catch (Exception e) {
        serial = "ESYDV000";
    }
    return new UUID(devIDShort.hashCode(), serial.hashCode()).toString();
}

From source file:Main.java

@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;//from   www.  ja va2s  . co m
}

From source file:count.ly.messaging.CrashDetails.java

/**
 * Returns the current device cpu.//from  w ww. j  a  v a  2s  .  c  o  m
 */
static String getCpu() {
    if (android.os.Build.VERSION.SDK_INT < 21)
        return android.os.Build.CPU_ABI;
    else
        return Build.SUPPORTED_ABIS[0];
}

From source file:ly.count.android.sdk.CrashDetails.java

/**
 * Returns the current device cpu./*from   w  w w.  j av a  2  s  . com*/
 */
@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];
}

From source file:org.namelessrom.devicecontrol.device.DeviceInformationGeneralFragment.java

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    addPreferencesFromResource(R.xml.device_information_general);

    final Device device = Device.get();

    // Platform//www  . j a  v  a 2s  .  c o  m
    PreferenceCategory category = (PreferenceCategory) findPreference("platform");

    addPreference(category, KEY_PLATFORM_VERSION, R.string.version, device.platformVersion).setSelectable(true); // selectable because of the easter egg
    addPreference(category, "platform_id", R.string.build_id, device.platformId);
    addPreference(category, "platform_type", R.string.type, device.platformType);
    addPreference(category, "platform_tags", R.string.tags, device.platformTags);
    addPreference(category, "platform_build_date", R.string.build_date, device.platformBuildType);

    // Runtime
    category = (PreferenceCategory) findPreference("runtime");

    addPreference(category, "vm_library", R.string.type, device.vmLibrary);
    addPreference(category, "vm_version", R.string.version, device.vmVersion);

    // Device
    category = (PreferenceCategory) findPreference("device_information");

    // TODO: save / restore / check --> ANDROID ID
    addPreference(category, KEY_ANDROID_ID, R.string.android_id, device.androidId);
    addPreference(category, "device_manufacturer", R.string.manufacturer, device.manufacturer);
    addPreference(category, "device_model", R.string.model, device.model);
    addPreference(category, "device_product", R.string.product, device.product);
    addPreference(category, "device_board", R.string.board, device.board);
    addPreference(category, "device_bootloader", R.string.bootloader, device.bootloader);
    addPreference(category, "device_radio_version", R.string.radio_version, device.radio);

    // eMMC
    category = (PreferenceCategory) findPreference("emmc");
    addPreference(category, "emmc_name", R.string.name, Emmc.get().getName());
    addPreference(category, "emmc_cid", R.string.emmc_cid, Emmc.get().getCid());
    addPreference(category, "emmc_mid", R.string.emmc_mid, Emmc.get().getMid());
    addPreference(category, "emmc_rev", R.string.emmc_rev, Emmc.get().getRev());
    addPreference(category, "emmc_date", R.string.emmc_date, Emmc.get().getDate());
    String tmp = Emmc.get().canBrick() ? getString(R.string.emmc_can_brick_true)
            : getString(R.string.emmc_can_brick_false);
    tmp = String.format("%s\n%s", tmp, getString(R.string.press_learn_more));
    addPreference(category, "emmc_can_brick", R.string.emmc_can_brick, tmp).setSelectable(true);

    // Processor
    category = (PreferenceCategory) findPreference("processor");

    final String cpuAbi = getString(R.string.cpu_abi);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        final int bitResId = Build.SUPPORTED_64_BIT_ABIS.length == 0 ? R.string.bit_32 : R.string.bit_64;
        addPreference(category, "cpu_bit", R.string.arch, getString(bitResId));
        for (int i = 0; i < Build.SUPPORTED_ABIS.length; i++) {
            addPreference(category, String.format("cpu_abi%s", i + 1), cpuAbi + String.valueOf(i + 1),
                    Build.SUPPORTED_ABIS[i]);
        }
    } else {
        //noinspection deprecation
        addPreference(category, "cpu_abi", cpuAbi, Build.CPU_ABI);
        //noinspection deprecation
        addPreference(category, "cpu_abi2", cpuAbi + "2", Build.CPU_ABI2);
    }
    new CpuInfoTask(category).execute();

    // Kernel
    category = (PreferenceCategory) findPreference("kernel");
    new KernelInfoTask(category).execute();

    // Memory
    category = (PreferenceCategory) findPreference("memory");
    new MemoryInfoTask(category).execute();

    if (category.getPreferenceCount() == 0) {
        getPreferenceScreen().removePreference(category);
    }
}

From source file:com.github.chenxiaolong.dualbootpatcher.socket.MbtoolConnection.java

@SuppressWarnings("deprecation")
private static String getAbi() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        return Build.SUPPORTED_ABIS[0];
    } else {//from  ww w.  j  ava 2s. c  om
        return Build.CPU_ABI;
    }
}

From source file:com.github.chenxiaolong.dualbootpatcher.switcher.service.BootUIActionTask.java

/**
 * Install or update boot UI/* ww w.j av a 2 s  .  com*/
 *
 * @param iface Mbtool interface
 * @return Whether the installation was successful
 * @throws IOException
 * @throws MbtoolException
 */
private boolean install(MbtoolInterface iface) throws IOException, MbtoolException {
    // Need to grab latest boot UI from the data archive
    PatcherUtils.initializePatcher(getContext());

    Device device = PatcherUtils.getCurrentDevice(getContext());
    if (device == null) {
        Log.e(TAG, "Failed to determine current device");
        return false;
    }

    // Uninstall first, so we don't get any leftover files
    Log.d(TAG, "Uninstalling before installing/updating");
    if (!uninstall(iface)) {
        return false;
    }

    String abi;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        abi = Build.SUPPORTED_ABIS[0];
    } else {
        //noinspection deprecation
        abi = Build.CPU_ABI;
    }

    File sourceDir = PatcherUtils.getTargetDirectory(getContext());
    String mountPoint = getCacheMountPoint(iface);

    for (FileMapping mapping : MAPPINGS) {
        String source = String.format(sourceDir + mapping.source, abi);
        String target = mountPoint + mapping.target;
        File parent = new File(target).getParentFile();

        try {
            iface.pathMkdir(parent.getAbsolutePath(), 0755, true);
            iface.pathCopy(source, target);
            iface.pathChmod(target, mapping.mode);
        } catch (MbtoolCommandException e) {
            Log.e(TAG, "Failed to install " + source + " -> " + target, e);
            return false;
        }
    }

    return true;
}