Example usage for android.os Build CPU_ABI

List of usage examples for android.os Build CPU_ABI

Introduction

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

Prototype

String CPU_ABI

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

Click Source Link

Document

The name of the instruction set (CPU type + ABI convention) of native code.

Usage

From source file:Main.java

public static String collectStats(CharSequence flattenedParams) {
    StringBuilder result = new StringBuilder(1000);

    result.append("BOARD=").append(Build.BOARD).append('\n');
    result.append("BRAND=").append(Build.BRAND).append('\n');
    result.append("CPU_ABI=").append(Build.CPU_ABI).append('\n');
    result.append("DEVICE=").append(Build.DEVICE).append('\n');
    result.append("DISPLAY=").append(Build.DISPLAY).append('\n');
    result.append("FINGERPRINT=").append(Build.FINGERPRINT).append('\n');
    result.append("HOST=").append(Build.HOST).append('\n');
    result.append("ID=").append(Build.ID).append('\n');
    result.append("MANUFACTURER=").append(Build.MANUFACTURER).append('\n');
    result.append("MODEL=").append(Build.MODEL).append('\n');
    result.append("PRODUCT=").append(Build.PRODUCT).append('\n');
    result.append("TAGS=").append(Build.TAGS).append('\n');
    result.append("TIME=").append(Build.TIME).append('\n');
    result.append("TYPE=").append(Build.TYPE).append('\n');
    result.append("USER=").append(Build.USER).append('\n');
    result.append("VERSION.CODENAME=").append(Build.VERSION.CODENAME).append('\n');
    result.append("VERSION.INCREMENTAL=").append(Build.VERSION.INCREMENTAL).append('\n');
    result.append("VERSION.RELEASE=").append(Build.VERSION.RELEASE).append('\n');
    result.append("VERSION.SDK_INT=").append(Build.VERSION.SDK_INT).append('\n');

    if (flattenedParams != null) {
        String[] params = SEMICOLON.split(flattenedParams);
        Arrays.sort(params);//from  www  .  ja  va2  s  .c  o m
        for (String param : params) {
            result.append(param).append('\n');
        }
    }

    return result.toString();
}

From source file:Main.java

@SuppressWarnings("deprecation")
public static String[] getABIList() {
    final String[] abis = new String[2];
    abis[0] = android.os.Build.CPU_ABI;
    abis[1] = android.os.Build.CPU_ABI2;
    return abis;// w w  w . ja  v  a 2 s.c o  m
}

From source file:com.azure.webapi.ServiceFilterRequestImpl.java

/**
 * Generates the User-Agent/*from  w  w w . j  ava 2s  .  co  m*/
 */
static String getUserAgent() {
    String userAgent = String.format("ZUMO/%s (lang=%s; os=%s; os_version=%s; arch=%s)", Constants.SDK_VERSION,
            "Java", "Android", Build.VERSION.RELEASE, Build.CPU_ABI);

    return userAgent;
}

From source file:titutorial.sysinfo.SysteminfoModule.java

@Kroll.method
public String getInfo() {
    JSONObject obj = new JSONObject();
    try {//from ww w  .  ja  v a2 s  .  c o m
        obj.put("OS_VERSION", android.os.Build.VERSION.RELEASE.toString());
        obj.put("API_LEVEL", (android.os.Build.VERSION.SDK_INT + "").toString());
        obj.put("MANUFACTURER", android.os.Build.MANUFACTURER.toString());
        obj.put("MODEL", android.os.Build.MODEL.toString());
        obj.put("RAM(kb)", getTotalRAM().toString());
        obj.put("RAM(mb)", getTotalRAMinMb().toString());
        obj.put("ABI", Build.CPU_ABI.toString());
        obj.put("PROCESSOR", getCPUInfo().toString());
    } catch (Exception e) {

    }

    return obj.toString();
}

From source file:com.microsoft.windowsazure.mobileservices.http.MobileServiceConnection.java

/**
 * Generates the User-Agent//ww  w .  j  a v  a2s  .c  om
 */
static String getUserAgent() {
    String userAgent = String.format("ZUMO/1.0 (lang=%s; os=%s; os_version=%s; arch=%s; version=%s)", "Java",
            "Android", Build.VERSION.RELEASE, Build.CPU_ABI, SDK_VERSION);

    return userAgent;
}

From source file:io.digibyte.tools.util.Utils.java

@SuppressWarnings("deprecation")
public static void printPhoneSpecs() {
    String specsTag = "PHONE SPECS";
    Log.e(specsTag, "");
    Log.e(specsTag, "***************************PHONE SPECS***************************");
    Log.e(specsTag, "* screen X: " + IntroActivity.screenParametersPoint.x + " , screen Y: "
            + IntroActivity.screenParametersPoint.y);
    Log.e(specsTag, "* Build.CPU_ABI: " + Build.CPU_ABI);
    Runtime rt = Runtime.getRuntime();
    long maxMemory = rt.maxMemory();
    Log.e(specsTag, "* maxMemory:" + Long.toString(maxMemory));
    Log.e(specsTag, "----------------------------PHONE SPECS----------------------------");
    Log.e(specsTag, "");
}

From source file:org.LK8000.LK8000.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    if (serviceClass == null)
        serviceClass = MyService.class;

    super.onCreate(savedInstanceState);
    //    Fabric.with(this, new Crashlytics(), new CrashlyticsNdk());

    Fabric fabric = new Fabric.Builder(this).debuggable(true).kits(new Crashlytics(), new CrashlyticsNdk())
            .build();/* w  ww  . j  a  v a 2 s  . com*/

    Fabric.with(fabric);

    Log.d(TAG, "ABI=" + Build.CPU_ABI);
    Log.d(TAG, "PRODUCT=" + Build.PRODUCT);
    Log.d(TAG, "MANUFACTURER=" + Build.MANUFACTURER);
    Log.d(TAG, "MODEL=" + Build.MODEL);
    Log.d(TAG, "DEVICE=" + Build.DEVICE);
    Log.d(TAG, "BOARD=" + Build.BOARD);
    Log.d(TAG, "FINGERPRINT=" + Build.FINGERPRINT);

    if (!Loader.loaded) {
        TextView tv = new TextView(this);
        tv.setText("Failed to load the native LK8000 libary.\n"
                + "Report this problem to us, and include the following information:\n" + "ABI=" + Build.CPU_ABI
                + "\n" + "PRODUCT=" + Build.PRODUCT + "\n" + "FINGERPRINT=" + Build.FINGERPRINT + "\n"
                + "error=" + Loader.error);
        setContentView(tv);
        return;
    }

    initialiseNative();

    NetUtil.initialise(this);
    InternalGPS.Initialize();
    NonGPSSensors.Initialize();

    IOIOHelper.onCreateContext(this);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR)
        // Bluetooth suppoert was added in Android 2.0 "Eclair"
        BluetoothHelper.Initialize(this);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD)
        // the DownloadManager was added in Android 2.3 "Gingerbread"
        DownloadUtil.Initialise(getApplicationContext());

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
        UsbSerialHelper.Initialise(this);
    }

    SoundUtil.Initialise();

    // fullscreen mode
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    /* Workaround for layout problems in Android KitKat with immersive full
       screen mode: Sometimes the content view was not initialized with the
       correct size, which caused graphics artifacts. */
    if (android.os.Build.VERSION.SDK_INT >= 19) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
                | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
                | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR
                | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    }

    enableImmersiveModeIfSupported();

    TextView tv = new TextView(this);
    tv.setText("Loading LK8000...");
    setContentView(tv);

    batteryReceiver = new BatteryReceiver();
    registerReceiver(batteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));

    SharedPreferences settings = getSharedPreferences("LK8000", 0);
    int screenOrientation = settings.getInt("screenOrientation", 0);
    switch (screenOrientation) {
    case 0:
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
        break;
    case 1:
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        break;
    case 2:
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        break;
    case 3:
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
        break;
    case 4:
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);
        break;
    default:
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
    }

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

}

From source file:com.github.feribg.audiogetter.helpers.Utils.java

/**
 * Return a string containing specific CPU information for the device
 *
 * @return//from w  ww  .  j  av  a2s.  c  o  m
 */
public static String getCpuInfo() {
    StringBuffer sb = new StringBuffer();
    sb.append("abi: ").append(Build.CPU_ABI).append("\n");
    if (new File("/proc/cpuinfo").exists()) {
        try {
            BufferedReader br = new BufferedReader(new FileReader(new File("/proc/cpuinfo")));
            String aLine;
            while ((aLine = br.readLine()) != null) {
                sb.append(aLine + "\n");
            }
            if (br != null) {
                br.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return sb.toString();
}

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

/**
 * Returns the current device cpu./*www. ja  v a  2  s . c  om*/
 */
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:com.github.chenxiaolong.dualbootpatcher.settings.AppSharingUtils.java

public static void updateRamdisk(Context context) throws Exception {
    PatcherUtils.extractPatcher(context);

    RomInformation romInfo = RomUtils.getCurrentRom(context);
    if (romInfo == null) {
        throw new Exception("Could not determine current ROM");
    }//from   w  w  w  . j a v  a  2 s  .  c om

    String bootImage = String.format(SwitcherUtils.KERNEL_PATH_ROOT, romInfo.id);
    RootFile bootImageFile = new RootFile(bootImage);

    if (!bootImageFile.isFile()) {
        SwitcherUtils.backupKernel(romInfo.id);
    }

    String tmpKernel = context.getCacheDir() + File.separator + "boot.img";
    RootFile tmpKernelFile = new RootFile(tmpKernel);
    bootImageFile.copyTo(tmpKernelFile);
    tmpKernelFile.chmod(0777);

    BootImage bi = new BootImage();
    if (!bi.load(tmpKernel)) {
        PatcherError error = bi.getError();
        throw new Exception("Error code: " + error.getErrorCode());
    }

    CpioFile cpio = new CpioFile();
    if (!cpio.load(bi.getRamdiskImage())) {
        PatcherError error = cpio.getError();
        throw new Exception("Error code: " + error.getErrorCode());
    }

    if (cpio.isExists("mbtool")) {
        cpio.remove("mbtool");
    }

    if (!cpio.addFile(
            PatcherUtils.getTargetDirectory(context) + "/binaries/android/" + Build.CPU_ABI + "/mbtool",
            "mbtool", 0755)) {
        PatcherError error = cpio.getError();
        throw new Exception("Error code: " + error.getErrorCode());
    }

    bi.setRamdiskImage(cpio.createData(true));

    if (!bi.createFile(tmpKernel)) {
        PatcherError error = bi.getError();
        throw new Exception("Error code: " + error.getErrorCode());
    }

    if (bi.isLoki()) {
        String aboot = context.getCacheDir() + File.separator + "aboot.img";
        SwitcherUtils.dd(SwitcherUtils.ABOOT_PARTITION, aboot);
        new RootFile(aboot).chmod(0666);

        String lokiKernel = context.getCacheDir() + File.separator + "kernel.lok";

        if (lokiPatch("boot", aboot, tmpKernel, lokiKernel) != 0) {
            throw new Exception("Failed to loki patch new boot image");
        }

        new File(lokiKernel).delete();

        org.apache.commons.io.FileUtils.moveFile(new File(lokiKernel), new File(tmpKernel));
    }

    // Copy to target
    new RootFile(tmpKernel).copyTo(bootImageFile);
    bootImageFile.chmod(0755);

    SwitcherUtils.writeKernel(romInfo.id);
}