Java Code Examples for android.os.Build#DEVICE

The following examples show how to use android.os.Build#DEVICE . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: edison-candle   File: BoardDefaults.java    License: Apache License 2.0 6 votes vote down vote up
private static String getBoardVariant() {
    if (!sBoardVariant.isEmpty()) {
        return sBoardVariant;
    }
    sBoardVariant = Build.DEVICE;
    // For the edison check the pin prefix
    // to always return Edison Breakout pin name when applicable.
    if (sBoardVariant.equals(DEVICE_EDISON)) {
        List<String> gpioList = PeripheralManager.getInstance().getGpioList();
        if (gpioList.size() != 0) {
            String pin = gpioList.get(0);
            if (pin.startsWith("IO")) {
                sBoardVariant = DEVICE_EDISON_ARDUINO;
            }
        }
    }
    return sBoardVariant;
}
 
Example 2
/**
 * Return the GPIO pin for the Voice Hat DAC trigger.
 */
public static String getGPIOForDacTrigger() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "BCM16";
        default:
            throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
    }
}
 
Example 3
Source Project: sample-button   File: BoardDefaults.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the GPIO pin that the LED is connected on.
 */
public static String getGPIOForLED() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "BCM6";
        case DEVICE_IMX6UL_PICO:
            return "GPIO4_IO22";
        case DEVICE_IMX7D_PICO:
            return "GPIO2_IO02";
        default:
            throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
    }
}
 
Example 4
private static String getDeviceInfos() {
    return ""
            + "\nOS Version: " + System.getProperty("os.version") + "(" + Build.VERSION.INCREMENTAL + ")"
            + "\nOS API Level: " + Build.VERSION.SDK_INT
            + "\nDevice: " + Build.DEVICE
            + "\nManufacturer: " + Build.MANUFACTURER
            + "\nModel (and Product): " + Build.MODEL + " (" + Build.PRODUCT + ")";
}
 
Example 5
/**
 * Return the GPIO pin that the LED is connected on.
 * For example, on Intel Edison Arduino breakout, pin "IO13" is connected to an onboard LED
 * that turns on when the GPIO pin is HIGH, and off when low.
 */
public static String getGPIOForLED() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "BCM25";
        case DEVICE_IMX6UL_PICO:
            return "GPIO4_IO22";
        case DEVICE_IMX7D_PICO:
            return "GPIO2_IO02";
        default:
            throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
    }
}
 
Example 6
Source Project: weatherstation   File: BoardDefaults.java    License: Apache License 2.0 5 votes vote down vote up
public static String getSpeakerPwmPin() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "PWM1";
        case DEVICE_IMX6UL_PICO:
            return "PWM8";
        case DEVICE_IMX7D_PICO:
            return "PWM2";
        default:
            throw new IllegalArgumentException("Unknown device: " + Build.DEVICE);
    }
}
 
Example 7
Source Project: sample-simplepio   File: BoardDefaults.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the GPIO pin that the LED is connected on.
 * For example, on Intel Edison Arduino breakout, pin "IO13" is connected to an onboard LED
 * that turns on when the GPIO pin is HIGH, and off when low.
 */
public static String getGPIOForLED() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "BCM6";
        case DEVICE_IMX6UL_PICO:
            return "GPIO4_IO22";
        case DEVICE_IMX7D_PICO:
            return "GPIO2_IO02";
        default:
            throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
    }
}
 
Example 8
Source Project: drivers-samples   File: BoardDefaults.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the UART for current board.
 */
public static String getUartName() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "UART0";
        case DEVICE_IMX6UL_PICO:
            return "UART3";
        case DEVICE_IMX7D_PICO:
            return "UART6";
        default:
            throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
    }
}
 
Example 9
Source Project: drivers-samples   File: BoardDefaults.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the preferred Clock GPIO pin for each board.
 */
public static String getGPIOforClock() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "BCM21";
        case DEVICE_IMX6UL_PICO:
            return "GPIO2_IO03";
        case DEVICE_IMX7D_PICO:
            return "GPIO6_IO14";
        default:
            throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
    }
}
 
Example 10
Source Project: drivers-samples   File: BoardDefaults.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Return the preferred I2C port for each board.
 */
public static String getI2CPort() {
    switch (Build.DEVICE) {
        case DEVICE_RPI3:
            return "I2C1";
        case DEVICE_IMX6UL_PICO:
            return "I2C2";
        case DEVICE_IMX7D_PICO:
            return "I2C1";
        default:
            throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
    }
}
 
Example 11
/**
 * Returns string with human-readable listing of Build.* parameters used in {@link #isEmulator()} method.
 * @return all involved Build.* parameters and its values
 */
public static String getDeviceListing() {
    return "Build.PRODUCT: " + Build.PRODUCT + "\n" +
           "Build.MANUFACTURER: " + Build.MANUFACTURER + "\n" +
           "Build.BRAND: " + Build.BRAND + "\n" +
           "Build.DEVICE: " + Build.DEVICE + "\n" +
           "Build.MODEL: " + Build.MODEL + "\n" +
           "Build.HARDWARE: " + Build.HARDWARE + "\n" +
           "Build.FINGERPRINT: " + Build.FINGERPRINT + "\n" + 
           "Build.TAGS: " + android.os.Build.TAGS + "\n" + 
           "GL_RENDERER: " +android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_RENDERER) + "\n" + 
           "GL_VENDOR: " +android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_VENDOR) + "\n" + 
           "GL_VERSION: " +android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_VERSION) + "\n" + 
           "GL_EXTENSIONS: " +android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_EXTENSIONS) + "\n";
}
 
Example 12
public static String getI2cBus() {
    String s = BoardSpec.getInstance().i2c;
    if (s!=null)
        return s;
    else
        throw new IllegalArgumentException("I2C Bus not Supported, Device: " + Build.DEVICE);
}
 
Example 13
public void startRecording(File outputFile, android.opengl.EGLContext sharedContext) {
    int resolution;
    int bitrate;
    String model = Build.DEVICE;
    if (model == null) {
        model = "";
    }
    if (model.startsWith("zeroflte") || model.startsWith("zenlte")) {
        resolution = 320;
        bitrate = 600000;
    } else {
        resolution = 240;
        bitrate = 400000;
    }

    videoFile = outputFile;
    videoWidth = resolution;
    videoHeight = resolution;
    videoBitrate = bitrate;
    sharedEglContext = sharedContext;

    synchronized (sync) {
        if (running) {
            return;
        }
        running = true;
        Thread thread = new Thread(this, "TextureMovieEncoder");
        thread.setPriority(Thread.MAX_PRIORITY);
        thread.start();
        while (!ready) {
            try {
                sync.wait();
            } catch (InterruptedException ie) {
                // ignore
            }
        }
    }
    handler.sendMessage(handler.obtainMessage(MSG_START_RECORDING));
}
 
Example 14
Source Project: Box   File: DeviceUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static String getDevice() {
    return Build.DEVICE;
}
 
Example 15
public static String getDeviceName() {
    return Build.DEVICE;
}
 
Example 16
Source Project: kernel_adiutor   File: Utils.java    License: Apache License 2.0 4 votes vote down vote up
public static String getDeviceName() {
    return Build.DEVICE;
}
 
Example 17
Source Project: 365browser   File: BuildInfo.java    License: Apache License 2.0 4 votes vote down vote up
@CalledByNative
public static String getDevice() {
    return Build.DEVICE;
}
 
Example 18
public static String getDevice() {
    return Build.DEVICE;
}
 
Example 19
Source Project: CameraView   File: DeviceUtil.java    License: Apache License 2.0 4 votes vote down vote up
public static String getDeviceModel() {
    return Build.DEVICE;
}
 
Example 20
Source Project: Android-utils   File: DeviceUtils.java    License: Apache License 2.0 2 votes vote down vote up
/**
 *  获取设备信息
 *
 * @return 设备信息
 */
public static String getDevice() {
    return Build.DEVICE;
}