Device 设备
稳定性: 稳定
device 模块提供了与设备有关的信息与操作,例如获取设备宽高,内存使用率,IMEI,调整设备亮度、音量等。
此模块的部分函数,例如调整音量,需要"修改系统设置"的权限。如果没有该权限,会抛出SecurityException并跳转到权限设置界面。
device.width
- {number}
设备屏幕分辨率宽度。例如 1080。
device.height
- {number}
设备屏幕分辨率高度。例如 1920。
device.buildId
- {string}
Either a changelist number, or a label like "M4-rc20".
修订版本号,或者诸如"M4-rc20"的标识。
device.broad
- {string}
The name of the underlying board, like "goldfish".
设备的主板(?)型号。
device.brand
- {string}
The consumer-visible brand with which the product/hardware will be associated, if any.
与产品或硬件相关的厂商品牌,如"Xiaomi", "Huawei"等。
device.device
- {string}
The name of the industrial design.
设备在工业设计中的名称。