harmony 鸿蒙Startup Development

  • 2023-06-24
  • 浏览 (586)

Startup Development

How do I obtain the system version of a device?

Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)

Solution

You can obtain the system version of a device through the osFullName attribute of the deviceInfo object.

Sample Code

import deviceInfo from '@ohos.deviceInfo'
let v = deviceInfo.osFullName

How do I obtain the UDID of a device?

Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)

Solution

  • Method 1: Run the hdc shell bm get –udid command.
  • Method 2: Obtain the value from the code. For details, see udid.

How do I obtain device information?

Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)

You can call deviceInfo to obtain device information, such as the device model.

Reference

Device Information

How do I prevent application development from being interrupted by screen saving?

Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)

Solution

Run the hdc shell “power-shell setmode 602” command to turn off screen saving.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙FAQs

harmony 鸿蒙Using NDK in a CMake Project

harmony 鸿蒙Application Access Control Development

harmony 鸿蒙Application Model Development

harmony 鸿蒙ArkUI Animation/Interaction Event Development (ArkTS)

harmony 鸿蒙ArkTS Syntax Usage

harmony 鸿蒙ArkUI Component Development (ArkTS)

harmony 鸿蒙ArkUI Development (JS)

harmony 鸿蒙ArkUI Layout Development (ArkTS)

harmony 鸿蒙ArkUI Routing/Navigation Development (ArkTS)

0  赞