DeviceUtils

class DeviceUtils
    author: Blankj
    blog  : http://blankj.com
    time  : 2016/8/1
    desc  : utils about device

Functions

getAndroidID
Link copied to clipboard
open fun getAndroidID(): String
Return the android id of device.
getMacAddress
Link copied to clipboard
@RequiresPermission(allOf = [])
open fun getMacAddress(): String
Return the MAC address.
getManufacturer
Link copied to clipboard
open fun getManufacturer(): String
Return the manufacturer of the product/hardware.
getModel
Link copied to clipboard
open fun getModel(): String
Return the model of device.
getSDKVersionCode
Link copied to clipboard
open fun getSDKVersionCode(): Int
Return version code of device's system.
getSDKVersionName
Link copied to clipboard
open fun getSDKVersionName(): String
Return the version name of device's system.
isDeviceRooted
Link copied to clipboard
open fun isDeviceRooted(): Boolean
Return whether device is rooted.
reboot
Link copied to clipboard
open fun reboot()
Reboot the device.
open fun reboot(reason: String)
Reboot the device.
reboot2Bootloader
Link copied to clipboard
open fun reboot2Bootloader()
Reboot the device to bootloader.
reboot2Recovery
Link copied to clipboard
open fun reboot2Recovery()
Reboot the device to recovery.
shutdown
Link copied to clipboard
open fun shutdown()
Shutdown the deviceRequires root permissionor hold {@code android:sharedUserId="android.uid.system"}, {@code