本文整理匯總了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);
}
}