Example usage for android.os Build MANUFACTURER

List of usage examples for android.os Build MANUFACTURER

Introduction

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

Prototype

String MANUFACTURER

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

Click Source Link

Document

The manufacturer of the product/hardware.

Usage

From source file:Main.java

public static String getDeviceName() {
    return Build.MANUFACTURER + " " + Build.MODEL;
}

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

/**
 * Retrieves the information(deviceId, sim serial number etc) of the device on which app is running 
 * //from  ww w. ja v a2  s . co m
 * @return the deviceID, if no deviceID is available the Android build MODEL is returned.
 */
public static String getDeviceName() {
    final String deviceName;

    String manufacturer = "" + Build.MANUFACTURER;
    String model = Build.MODEL;

    if (model.startsWith(manufacturer)) {
        deviceName = model;
    } else {
        deviceName = manufacturer + " " + model;
    }

    return deviceName;
}

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 ww  .j ava 2 s  . c  o m*/
    return m_szDevIDShort;
}

From source file:Main.java

public static void logDeviceInfo(String tag) {
    Log.d(tag,//from ww w. j  a 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 isMagicBoxDevice() {
    String manufacturer = Build.MANUFACTURER;
    String productName = Build.PRODUCT;
    return manufacturer.equalsIgnoreCase("MagicBox") && productName.equalsIgnoreCase("MagicBox");
}

From source file:Main.java

/** Information about the current build, taken from system properties. */
public static void logDeviceInfo(String tag) {
    Log.d(tag,/*ww w . j a va2s . 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

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

/**
 * Get unique device info.// w ww. jav a2  s.  c om
 *
 * @param context application context.
 * @return returns a json object of the device, manufacturer, build version, and a unique id.
 */
public static JSONObject getDeviceInfo(Context context) {
    JSONObject deviceInfo = new JSONObject();
    try {
        deviceInfo.put("device", Build.MODEL);
        deviceInfo.put("manufacturer", Build.MANUFACTURER);
        deviceInfo.put("android", android.os.Build.VERSION.SDK);

        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);

        String tmDevice = tm.getDeviceId();
        String androidId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
        String serial = null;
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO)
            serial = Build.SERIAL;
        if (androidId != null)
            deviceInfo.put("uid", androidId);
        else if (serial != null)
            deviceInfo.put("uid", serial);
        else if (tmDevice != null)
            deviceInfo.put("uid", tmDevice);
        deviceInfo.put("carrier", tm.getNetworkOperatorName());
    } catch (JSONException e) {
        e.printStackTrace();
    }
    return deviceInfo;
}

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  ww .  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();
}