Java Code Examples for android.os.Build#DEVICE

The following examples show how to use android.os.Build#DEVICE . 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 File: BoardDefaults.java    From edison-candle with 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
Source File: BoardDefaults.java    From sample-button with 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 3
Source File: InstantCameraView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
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 4
Source File: BoardSpec.java    From androidthings-cameraCar with Apache License 2.0 5 votes vote down vote up
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 5
Source File: EmulatorDetector.java    From android-emulator-detector with Apache License 2.0 5 votes vote down vote up
/**
 * 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 6
Source File: BoardDefaults.java    From drivers-samples with 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 7
Source File: BoardDefaults.java    From drivers-samples with 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 8
Source File: BoardDefaults.java    From drivers-samples with 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 File: BoardDefaults.java    From sample-simplepio with 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 10
Source File: BoardDefaults.java    From weatherstation with 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 11
Source File: BoardDefaults.java    From androidthings-googleassistant with 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 "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 12
Source File: ExceptionUtil.java    From nextcloud-notes with GNU General Public License v3.0 5 votes vote down vote up
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 13
Source File: BoardDefaults.java    From sample-googleassistant with Apache License 2.0 5 votes vote down vote up
/**
 * 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 14
Source File: DeviceUtils.java    From Box with Apache License 2.0 4 votes vote down vote up
public static String getDevice() {
    return Build.DEVICE;
}
 
Example 15
Source File: Device.java    From SmartPack-Kernel-Manager with GNU General Public License v3.0 4 votes vote down vote up
public static String getDeviceName() {
    return Build.DEVICE;
}
 
Example 16
Source File: Utils.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static String getDeviceName() {
    return Build.DEVICE;
}
 
Example 17
Source File: BuildInfo.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@CalledByNative
public static String getDevice() {
    return Build.DEVICE;
}
 
Example 18
Source File: AndroidUtil.java    From VideoOS-Android-SDK with GNU General Public License v3.0 4 votes vote down vote up
public static String getDevice() {
    return Build.DEVICE;
}
 
Example 19
Source File: DeviceUtil.java    From CameraView with Apache License 2.0 4 votes vote down vote up
public static String getDeviceModel() {
    return Build.DEVICE;
}
 
Example 20
Source File: DeviceUtils.java    From Android-utils with Apache License 2.0 2 votes vote down vote up
/**
 *  获取设备信息
 *
 * @return 设备信息
 */
public static String getDevice() {
    return Build.DEVICE;
}