Example usage for android.os Build MODEL

List of usage examples for android.os Build MODEL

Introduction

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

Prototype

String MODEL

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

Click Source Link

Document

The end-user-visible name for the end product.

Usage

From source file:Main.java

public static String getFriendlyDeviceName() {
    if (isRunningOnGenymotion()) {
        // Genymotion already has a friendly name by default
        return Build.MODEL;
    } else {//from   www.  j a  va  2 s  . co m
        return Build.MODEL + " - " + Build.VERSION.RELEASE + " - API " + Build.VERSION.SDK_INT;
    }
}

From source file:Main.java

public static boolean useWave() {
    boolean b = true;
    String device = Build.MODEL;
    if (device == null) {
        b = false;/* ww w .j  a va2 s  .c  o  m*/
    } else {
        for (int i = 0; i < aryDevice.length; i++) {
            if (aryDevice[i].equals(device)) {
                b = false;
                break;
            }
        }
    }
    return b;
}

From source file:Main.java

public static String getDeviceSerial() {
    return "Build.SERIAL: " + Build.SERIAL + "\n" + "Build.MANUFACTURER: " + Build.MANUFACTURER + "\n"
            + "Build.MODEL: " + Build.MODEL + "\n";
}

From source file:Main.java

/**
 * device model name, e.g: GT-I9100
 *
 * @return the user_Agent
 */
public static String getDevice() {
    return 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

public static void BrightnessSetValue(Window window, int value) {
    WindowManager.LayoutParams lp = window.getAttributes();
    if (Build.MODEL != null && Build.MODEL.indexOf("MEIZU MX") > -1) {
        lp.screenBrightness = 0.6f + value * 3 / 100f;
        window.setAttributes(lp);//  w  ww . ja v  a  2 s .c o  m
    } else {
        if (value > 10)
            value = 10;
        if (value < 0)
            value = 0;
        float bright = value;
        bright /= 10.0f;
        lp.screenBrightness = bright;
        window.setAttributes(lp);
    }
}

From source file:Main.java

public static boolean supportsExtraOutput(String intentAction) {
    if (Build.MANUFACTURER.equalsIgnoreCase("samsung")
            && (Build.MODEL.startsWith("GT-") || Build.MODEL.startsWith("SM-"))) {
        // Samsung *Galaxy Models* contain a Camera app that does not implement EXTRA_OUTPUT properly.
        // Either doesn't support it or have a different behavior than the specified (e.g. Copies the
        // media file to both the destination path in the uri and the default gallery path).
        return false;
    }//from   w ww.  ja  va  2  s  . c o m

    if (MediaStore.ACTION_IMAGE_CAPTURE.equals(intentAction)) {
        // Nexus One and other devices must use EXTRA_OUTPUT due to a bug with the default mechanism.
        // http://thanksmister.com/2012/03/16/android_null_data_camera_intent/
        return true;
    } else if (MediaStore.ACTION_VIDEO_CAPTURE.equals(intentAction)) {
        // Some older devices like the Nexus One for ACTION_VIDEO_CAPTURE, don't support it. Use only on >= ICS.
        // Also, make sure to use EXTRA_OUTPUT due to a bug in Android 4.3 and later if not using it.
        // https://code.google.com/p/android/issues/detail?id=57996
        return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH);
    } else { // MediaStore.Audio.Media.RECORD_SOUND_ACTION
        return true;
    }
}

From source file:Main.java

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

From source file:Main.java

/** Returns the consumer friendly device name */
public static String getDeviceName() {
    final String manufacturer = Build.MANUFACTURER;
    final String model = Build.MODEL;
    if (model.startsWith(manufacturer)) {
        return capitalize(model);
    }/*from w  w w  .j  a  v  a 2  s.  co m*/
    if (manufacturer.equalsIgnoreCase("HTC")) {
        // make sure "HTC" is fully capitalized.
        return "HTC " + model;
    }
    return capitalize(manufacturer) + " " + model;
}

From source file:Main.java

/**
 * Generates client ID for Android device.
 * @param context used to generate hostname.
 * @return hostname.//  ww w  .j  av a2s .c  o  m
 */
public static String getClientId(Context context) {
    return Build.MODEL.replaceAll(" ", "-") + "-"
            + Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
}