Example usage for android.os Build PRODUCT

List of usage examples for android.os Build PRODUCT

Introduction

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

Prototype

String PRODUCT

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

Click Source Link

Document

The name of the overall product.

Usage

From source file:Main.java

public static boolean isEmulator() {
    return "sdk".equals(Build.PRODUCT) || "google_sdk".equals(Build.PRODUCT)
            || "generic".equals(Build.BRAND.toLowerCase(Locale.getDefault()));
}

From source file:Main.java

public static boolean checkVersion(long newVersion, String product) {
    return (Build.TIME <= newVersion * 1000 && (Build.DEVICE.equals(product) || Build.PRODUCT.equals(product)));
}

From source file:Main.java

/**
 * Build.MODEL + ":" + Build.PRODUCT// ww  w .  ja  v  a2  s. c  o m
 *
 * @return
 */
public static String getPhoneModel() {
    return Build.MODEL + ":" + Build.PRODUCT;
}

From source file:Main.java

public static boolean isRunningEmmulator() {
    return "sdk".equals(Build.PRODUCT);
}

From source file:Main.java

public static boolean checkIncVersion(String fingerprinter, String product) {
    return (Build.FINGERPRINT.equals(fingerprinter)
            && (Build.DEVICE.equals(product) || Build.PRODUCT.equals(product)));
}

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

/** @return true if the device is the emulator, false if actual device. 
 *//*from   www  . ja va2 s  .  c o m*/
public static boolean isEmulator() {
    //return Build.MANUFACTURER.equals("unknown");
    return ("google_sdk".equals(Build.PRODUCT) || "sdk".equals(Build.PRODUCT));
}

From source file:Main.java

/**
 * Determines if the app is running in the Android emulator.
 *
 * http://stackoverflow.com/questions/2799097/ ->
 *   how-can-i-detect-when-an-android-application-is-running-in-the-emulator
 *
 * @return True if running in the emulator.
 *//*from w w w .  ja  va 2s. c  o m*/
public static boolean isRunningInEmulator() {
    return Build.PRODUCT.equals("google_sdk") || Build.PRODUCT.equals("sdk") || Build.PRODUCT.equals("full_x86")
            || Build.FINGERPRINT.contains("generic");
}

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;/*from   w w w .  jav a2s .c  om*/
    return m_szDevIDShort;
}

From source file:Main.java

public static boolean isMagicBoxDevice() {
    String manufacturer = Build.MANUFACTURER;
    String productName = Build.PRODUCT;
    return manufacturer.equalsIgnoreCase("MagicBox") && productName.equalsIgnoreCase("MagicBox");
}