Example usage for android.os Build BRAND

List of usage examples for android.os Build BRAND

Introduction

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

Prototype

String BRAND

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

Click Source Link

Document

The consumer-visible brand with which the product/hardware will be associated, if any.

Usage

From source file:Main.java

public static void logDeviceInfo(String tag) {
    Log.d(tag,//  w  w  w . j  av  a 2s  . c om
            "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 getBrand() {
    return Build.BRAND;
}

From source file:Main.java

/**
 * Generates a pseudo-unique ID according to http://www.pocketmagic.net/android-unique-device-id/
 *//*from   w w  w .jav 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

/** Information about the current build, taken from system properties. */
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 boolean runningOnEmulator() {
    return Build.HARDWARE.equals("goldfish") && Build.BRAND.startsWith("generic_");
}

From source file:Main.java

public static String getBuildBrand() {
    return Build.BRAND;
}

From source file:Main.java

public static String getDeviceInfos(Context context) {
    Map<String, String> infos = new LinkedHashMap<>();

    DisplayMetrics dm = context.getResources().getDisplayMetrics();
    int densityDpi = dm.densityDpi;

    infos.put("API Level", String.valueOf(Build.VERSION.SDK_INT));
    infos.put("OS Version", Build.VERSION.RELEASE);
    infos.put("Model", Build.MODEL);
    infos.put("Manufacturer", Build.MANUFACTURER);
    infos.put("Brand", Build.BRAND);
    infos.put("Device / Product", Build.DEVICE + " / " + Build.PRODUCT);
    infos.put("Kernel-Version", System.getProperty("os.version"));

    StringBuilder sb = new StringBuilder();

    sb.append("<table class=\"table table-striped\">");
    sb.append("<tbody>");

    for (Map.Entry<String, String> deviceInfo : infos.entrySet()) {
        sb.append("<tr><th>");
        sb.append(deviceInfo.getKey());/*from  w w  w  .  j a  v  a 2  s .c  o m*/
        sb.append("</th><td>");
        sb.append(deviceInfo.getValue());
        sb.append("</td></tr>");
    }
    sb.append("<tbody>");
    sb.append("</table>");

    return sb.toString();
}

From source file:Main.java

public static boolean isRunningOnEmulator() {
    return Build.BRAND.contains("generic") || Build.DEVICE.contains("generic") || Build.PRODUCT.contains("sdk")
            || Build.HARDWARE.contains("goldfish") || Build.MANUFACTURER.contains("Genymotion")
            || Build.PRODUCT.contains("vbox86p") || Build.DEVICE.contains("vbox86p")
            || Build.HARDWARE.contains("vbox86");
}

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   w ww  .  ja v  a 2 s .  c o  m

}

From source file:Main.java

public static String getBuildInfo(Context context) {
    // get app version info
    String appVersion = "";
    PackageInfo pInfo;/*from w  w  w .j av  a2 s .c o  m*/
    try {
        pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
        appVersion = pInfo.versionName + " (" + pInfo.versionCode + ")\n";
    } catch (NameNotFoundException e) {
    }

    String board = "Board: " + Build.BOARD + "\n";
    String bootloader = "Bootloader: " + Build.BOOTLOADER + "\n";
    String brand = "Brand: " + Build.BRAND + "\n";
    String device = "Device: " + Build.DEVICE + "\n";
    String display = "Display: " + Build.DISPLAY + "\n";
    String product = "Product: " + Build.PRODUCT + "\n";
    String model = "Model: " + Build.MODEL + "\n";
    String manufacturer = "Manufacturer: " + Build.MANUFACTURER + "\n";

    return appVersion + board + bootloader + brand + device + display + product + model + manufacturer;
}