本文整理汇总了Java中android.os.Build.DEVICE属性的典型用法代码示例。如果您正苦于以下问题:Java Build.DEVICE属性的具体用法?Java Build.DEVICE怎么用?Java Build.DEVICE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.os.Build
的用法示例。
在下文中一共展示了Build.DEVICE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBoardVariant
/**
* Get board variant.
*
* @return Name of the board.
*/
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)) {
PeripheralManagerService pioService = new PeripheralManagerService();
List<String> gpioList = pioService.getGpioList();
if (gpioList.size() != 0) {
String pin = gpioList.get(0);
if (pin.startsWith("IO")) {
sBoardVariant = DEVICE_EDISON_ARDUINO;
}
}
}
return sBoardVariant;
}
示例2: getGPIOForButton
/**
* Return the GPIO pin that the Button is connected on.
*/
public static String getGPIOForButton() {
switch (getBoardVariant()) {
case DEVICE_EDISON_ARDUINO:
return "IO12";
case DEVICE_EDISON:
return "GP44";
case DEVICE_JOULE:
return "J7_71";
case DEVICE_RPI3:
return "BCM21";
case DEVICE_IMX6UL_PICO:
return "GPIO4_IO20";
case DEVICE_IMX6UL_VVDN:
return "GPIO3_IO01";
case DEVICE_IMX7D_PICO:
return "GPIO_174";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
示例3: getHandSetInfo
private static String getHandSetInfo() {
String handSetInfo = "手机型号:" + Build.MODEL
+ "\n系统版本:" + Build.VERSION.RELEASE
+ "\n产品型号:" + Build.PRODUCT
+ "\n版本显示:" + Build.DISPLAY
+ "\n系统定制商:" + Build.BRAND
+ "\n设备参数:" + Build.DEVICE
+ "\n开发代号:" + Build.VERSION.CODENAME
+ "\nSDK版本号:" + Build.VERSION.SDK_INT
+ "\nCPU类型:" + Build.CPU_ABI
+ "\n硬件类型:" + Build.HARDWARE
+ "\n主机:" + Build.HOST
+ "\n生产ID:" + Build.ID
+ "\nROM制造商:" + Build.MANUFACTURER // 这行返回的是rom定制商的名称
;
Log.e("tt",handSetInfo);
return handSetInfo;
}
示例4: getGPIOForBtnA
/**
* 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 getGPIOForBtnA() {
switch (getBoardVariant()) {
case DEVICE_EDISON_ARDUINO:
return "IO13";
case DEVICE_EDISON:
return "GP45";
case DEVICE_RPI3:
return "BCM21";
case DEVICE_NXP:
return "GPIO4_IO20";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
示例5: getGPIOForLCDD6
public static String getGPIOForLCDD6() {
switch (getBoardVariant()) {
case DEVICE_RPI3:
return "BCM16";
default:
throw new IllegalStateException("Unknown board " + Build.DEVICE);
}
}
示例6: getGPIOForDisconnectAllBTDevices
/**
* Return the GPIO pin with a button that will trigger the Disconnect All command.
*/
public static String getGPIOForDisconnectAllBTDevices() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
return "BCM20";
case DEVICE_IMX6UL_PICO:
return "GPIO4_IO22";
case DEVICE_IMX7D_PICO:
return "GPIO6_IO15";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
示例7: getGPIOForLED
/**
* 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);
}
}
示例8: convert
public static String convert(@NonNull String requestId) {
SpeechConfig message = new SpeechConfig();
System system = new System();
// This sample does not use Speech SDK, but this value is needed, so set fixed value;
system.version = "2.0.12341";
Os os = new Os();
os.platform = "Android";
os.name = Build.VERSION.CODENAME;
os.version = String.valueOf(Build.VERSION.SDK_INT);
Device device = new Device();
device.manufacturer = Build.BRAND;
device.model = Build.DEVICE;
device.version = Build.VERSION.RELEASE;
message.context.system = system;
message.os = os;
message.device = device;
String json = JsonMapper.toJson(message);
return PATH.getValue() + ": " + SPEECH_CONFIG.getValue() + CRLF.getValue() +
X_REQUEST_ID.getValue() + ": " + requestId + CRLF.getValue() +
X_TIMESTAMP.getValue() + ": " + CurrentTime.newTime() + CRLF.getValue() +
CONTENT_TYPE.getValue() + ": " + APPLICATION_JSON.getValue() + CRLF.getValue() + CRLF.getValue() + json;
}
示例9: getGPIOForBtnC
/**
* 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 getGPIOForBtnC() {
switch (getBoardVariant()) {
case DEVICE_EDISON_ARDUINO:
return "IO13";
case DEVICE_EDISON:
return "GP45";
case DEVICE_RPI3:
return "BCM16";
case DEVICE_NXP:
return "GPIO4_IO20";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
示例10: getGPIOForTrig
/**
* Return the GPIO pin for the trigger pin in HC-SR04 sensor.
* <p>
* See: https://pinout.xyz/pinout/
*/
public static String getGPIOForTrig() {
switch (getBoardVariant()) {
case DEVICE_RPI3:
return "BCM5";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}
示例11: getGPIOForMotionDetector
public static String getGPIOForMotionDetector() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
return "BCM21";
case DEVICE_IMX6UL_PICO:
return "GPIO4_IO20";
case DEVICE_IMX7D_PICO:
return "GPIO6_IO14";
default:
throw new IllegalArgumentException("Unknown device: " + Build.DEVICE);
}
}
示例12: getGPIOForLCDRs
public static String getGPIOForLCDRs() {
switch (getBoardVariant()) {
case DEVICE_RPI3:
return "BCM26";
default:
throw new IllegalStateException("Unknown board " + Build.DEVICE);
}
}
示例13: getDeviceListing
/**
*
* @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.CPU_ABI: " + Build.CPU_ABI + "\n" +
"Build.CPU_ABI2: " + Build.CPU_ABI2 + "\n" +
"Build.HOST: " + Build.HOST;
}
示例14: getI2cBusForSensors
public static String getI2cBusForSensors() {
switch (Build.DEVICE) {
case DEVICE_RPI3:
return "I2C1";
case DEVICE_IMX6UL_PICO:
return "I2C2";
case DEVICE_IMX7D_PICO:
return "I2C1";
default:
throw new IllegalArgumentException("Unknown device: " + Build.DEVICE);
}
}
示例15: getGPIOForLED
/**
* 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_IO20";
case DEVICE_IMX7D_PICO:
return "GPIO2_IO02";
default:
throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
}
}