Example usage for android.os Build ID

List of usage examples for android.os Build ID

Introduction

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

Prototype

String ID

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

Click Source Link

Document

Either a changelist number, or a label like "M4-rc20".

Usage

From source file:Main.java

public static boolean isMiui() {
    boolean bool = false;
    if ((Build.MANUFACTURER.contains("MIUI")) || (Build.ID.contains("MIUI")) || (Build.MODEL.contains("MIUI"))
            || (Build.MODEL.startsWith("MI-ONE"))) {
        bool = true;/* ww  w.j  a v a2s .  com*/
    }
    return bool;
}

From source file:Main.java

public static String GetDeviceInfo() {
    String deviceInfo = "Device={0};Hardware={1};ID={2};Model={3};Product={4};MANUFACTURER={5};User={6};";
    return String.format(deviceInfo, Build.DEVICE, Build.HARDWARE, Build.ID, Build.MODEL, Build.PRODUCT,
            Build.MANUFACTURER, Build.USER);
}

From source file:Main.java

public static void logDeviceInfo(String tag) {
    Log.d(tag,//from   w ww  .  ja va 2  s  .c o  m
            "Android SDK: " + Build.VERSION.SDK_INT + ", " + "Release: " + Build.VERSION.RELEASE + ", "
                    + "Brand: " + Build.BRAND + ", " + "Device: " + Build.DEVICE + ", " + "Id: " + Build.ID
                    + ", " + "Hardware: " + Build.HARDWARE + ", " + "Manufacturer: " + Build.MANUFACTURER + ", "
                    + "Model: " + Build.MODEL + ", " + "Product: " + Build.PRODUCT);
}

From source file:Main.java

public static String getUniqueId() {
    String m_szDevIDShort = "35" + //we make this look like a valid IMEI
            Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.CPU_ABI.length() % 10
            + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10
            + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10
            + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10
            + Build.USER.length() % 10;// ww w .jav a2  s  . c om
    return m_szDevIDShort;
}

From source file:Main.java

/** Information about the current build, taken from system properties. */
public static void logDeviceInfo(String tag) {
    Log.d(tag,//from  w w  w .  j ava 2 s .  c o m
            "Android SDK: " + Build.VERSION.SDK_INT + ", " + "Release: " + Build.VERSION.RELEASE + ", "
                    + "Brand: " + Build.BRAND + ", " + "Device: " + Build.DEVICE + ", " + "Id: " + Build.ID
                    + ", " + "Hardware: " + Build.HARDWARE + ", " + "Manufacturer: " + Build.MANUFACTURER + ", "
                    + "Model: " + Build.MODEL + ", " + "Product: " + Build.PRODUCT);
}

From source file:Main.java

/**
 * Generates a pseudo-unique ID according to http://www.pocketmagic.net/android-unique-device-id/
 *///from   w  ww .  j a v a 2s .  c o  m
static String generateDeviceId() {
    return "35" + //we make this look like a valid IMEI
            Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.CPU_ABI.length() % 10
            + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10
            + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10
            + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10
            + Build.USER.length() % 10; //13 digits
}

From source file:Main.java

public static String getBuildID() {
    return Build.ID;
}

From source file:Main.java

public static String getSystemInfo() {
    String a = "BOARD" + Build.BOARD;
    a += "BRAND" + Build.BRAND;
    a += "CPU_ABI" + Build.CPU_ABI;
    a += "DEVICE" + Build.DEVICE;
    a += "DISPLAY" + Build.DISPLAY;
    a += "FINGERPRINT" + Build.FINGERPRINT;
    a += "HOST" + Build.HOST;
    a += "ID" + Build.ID;
    a += "MANUFACTURER" + Build.MANUFACTURER;
    a += "MODEL" + Build.MODEL;
    a += "PRODUCT" + Build.PRODUCT;
    a += "TAGS" + Build.TAGS;
    a += "TYPE" + Build.TYPE;
    a += "USER" + Build.USER;
    return a;//from  www  .ja  v  a  2s  .  c o  m

}

From source file:Main.java

public static String getDeviceId(Context context) {
    try {//from   w  w w  .  j  a v  a  2s .c  om
        TelephonyManager TelephonyMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        String szImei = TelephonyMgr.getDeviceId(); // Requires READ_PHONE_STATE
        return szImei;
    } catch (Exception e) {
        // Oh well
    }
    try {
        String m_szDevIDShort = "35" + //we make this look like a valid IMEI
                Build.BOARD.length() % 10 + Build.BRAND.length() % 10 + Build.CPU_ABI.length() % 10
                + Build.DEVICE.length() % 10 + Build.DISPLAY.length() % 10 + Build.HOST.length() % 10
                + Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 + Build.MODEL.length() % 10
                + Build.PRODUCT.length() % 10 + Build.TAGS.length() % 10 + Build.TYPE.length() % 10
                + Build.USER.length() % 10; //13 digits
        return m_szDevIDShort;
    } catch (Exception e) {
        // Oh well
    }
    return "tempid" + getRandom().nextInt();
}

From source file:Main.java

private static String i(Context context) {
    if (h == null) {
        String s = (new WebView(context)).getSettings().getUserAgentString();
        if (s == null || s.length() == 0 || s.equals("Java0")) {
            String s1 = System.getProperty("os.name", "Linux");
            String s2 = (new StringBuilder()).append("Android ").append(android.os.Build.VERSION.RELEASE)
                    .toString();/*  w ww .ja va2 s  .co m*/
            Locale locale = Locale.getDefault();
            String s3 = locale.getLanguage().toLowerCase();
            if (s3.length() == 0)
                s3 = "en";
            String s4 = locale.getCountry().toLowerCase();
            String s5;
            String s6;
            if (s4.length() > 0)
                s5 = (new StringBuilder()).append(s3).append("-").append(s4).toString();
            else
                s5 = s3;
            s6 = (new StringBuilder()).append(Build.MODEL).append(" Build/").append(Build.ID).toString();
            s = (new StringBuilder()).append("Mozilla/5.0 (").append(s1).append("; U; ").append(s2).append("; ")
                    .append(s5).append("; ").append(s6).append(") AppleWebKit/0.0 (KHTML, like ")
                    .append("Gecko) Version/0.0 Mobile Safari/0.0").toString();
        }
        h = (new StringBuilder()).append(s).append(" (Mobile; ").append("afma-sdk-a-v").append("4.1.0")
                .append(")").toString();
    }
    return h;
}