From af3f9781093abc82450599de627a1983ed993297 Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Tue, 6 Dec 2022 20:22:25 +0800 Subject: [PATCH] Update doc (10313) Signed-off-by: ester.zhou --- .../faqs/faqs-development-board.md | 6 +-- .../faqs/faqs-device-management.md | 34 ++++++++++++-- en/application-dev/faqs/faqs-ui-js.md | 46 +++++++++---------- 3 files changed, 54 insertions(+), 32 deletions(-) diff --git a/en/application-dev/faqs/faqs-development-board.md b/en/application-dev/faqs/faqs-development-board.md index 4766d4f527..79e5fc390f 100644 --- a/en/application-dev/faqs/faqs-development-board.md +++ b/en/application-dev/faqs/faqs-development-board.md @@ -1,6 +1,4 @@ -# Development Board - - +# Development Board Usage ## How do I take screenshots on a development board? @@ -29,8 +27,8 @@ Applicable to: DevEco Studio 3.0.0.991 1. Create a profile in Previewer. ![en-us_image_0000001361254285](figures/en-us_image_0000001361254285.png) -2. Set the profile parameters as follows: +2. Set the profile parameters as follows: Device type : default Resolution: 720\*1280 diff --git a/en/application-dev/faqs/faqs-device-management.md b/en/application-dev/faqs/faqs-device-management.md index 5bb748f758..dd836eb11a 100644 --- a/en/application-dev/faqs/faqs-device-management.md +++ b/en/application-dev/faqs/faqs-device-management.md @@ -1,12 +1,10 @@ # Device Management Development - - ## How do I obtain the DPI of a device? Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9 -Import the **@ohos.display** module and call the **getDefaultDisplay** API. +Import the **\@ohos.display** module and call the **getDefaultDisplay** API. Example: @@ -20,5 +18,33 @@ display.getDefaultDisplay((err, data) => { } console.info('Test Succeeded in obtaining the default display object. Data:' + JSON.stringify(data)); console.info('Test densityDPI:' + JSON.stringify(data.densityDPI)); -});https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-device-info.md) +}); ``` + +## How do I obtain the type of the device where the application is running? + +Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9 + +Import the **\@ohos.deviceInfo** module and call the **deviceInfo.deviceType** API. + +For details, see [Device Information](../reference/apis/js-apis-device-info.md). + +## How do I obtain the system version of a device? + +Applicable to: OpenHarmony SDK 3.2.5.5, stage model of API version 9 + +Use the **osFullName** attribute of the [deviceInfo](../reference/apis/js-apis-device-info.md) object. + +## How do I obtain the UDID of an OpenHarmony device? + +Applicable to: OpenHarmony SDK3.0, stage model of API version 9 + +- To obtain the UDID of the connected device, run the **hdc shell bm get --udid** command. + +- For details about how to obtain the UDID from code, see [udid](../reference/apis/js-apis-device-info.md). + +## How do I develop a shortcut key function? + +Applicable to: OpenHarmony SDK 3.2.6.5, stage model of API version 9 + +To develop a shortcut key function, use the APIs in [Input Consumer](../reference/apis/js-apis-inputconsumer.md). diff --git a/en/application-dev/faqs/faqs-ui-js.md b/en/application-dev/faqs/faqs-ui-js.md index 7d4ae1dcb8..c60ff729ea 100644 --- a/en/application-dev/faqs/faqs-ui-js.md +++ b/en/application-dev/faqs/faqs-ui-js.md @@ -1,7 +1,5 @@ # ArkUI (JavaScript) Development - - ## How do I convert the fields in an XML file into JavaScript objects? Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9 @@ -13,38 +11,37 @@ Example: ``` import convertxml from '@ohos.convertxml'; -// Code snippet -xml = +// XML strings +let xml = '' + '' + ' Happy' + ' Work' + ' Play' + ''; -let conv = new convertxml.ConvertXML(); +let conv = new convertxml.ConvertXML(); // Options for conversion. For details, see the reference document. -let options = {trim : false, declarationKey:"_declaration", - instructionKey : "_instruction", attributesKey : "_attributes", - textKey : "_text", cdataKey:"_cdata", doctypeKey : "_doctype", - commentKey : "_comment", parentKey : "_parent", typeKey : "_type", - nameKey : "_name", elementsKey : "_elements"} -let result:any = conv.convert(xml, options) // Convert fields in the XML file into JavaScript objects. +let options = { + trim: false, + declarationKey: "_declaration", + instructionKey: "_instruction", + attributesKey: "_attributes", + textKey: "_text", + cdataKey: "_cdata", + doctypeKey: "_doctype", + commentKey: "_comment", + parentKey: "_parent", + typeKey: "_type", + nameKey: "_name", + elementsKey: "_elements" +} +let result: any = conv.convert(xml, options) // Convert fields in the XML file into JavaScript objects. console.log('Test: ' + JSON.stringify(result)) -console.log('Test: ' + result._declaration._attributes.version) // version field in XML file -console.log('Test: ' + result._elements[0]._elements[0]._elements[0]._text) // title field in XML file +console.log('Test: ' + result._declaration._attributes.version) // version field in the XML file +console.log('Test: ' + result._elements[0]._elements[0]._elements[0]._text) // title field in the XML file ``` -Reference: [XML-to-JavaScript Conversion](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-convertxml.md) - -## What are the differences between JavaScript, TypeScript, and eTS? - -Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9 - -- JavaScript: a lightweight, weakly-typed programming language, most commonly known as the scripting language for web pages. - -- TypeScript: a superset of JavaScript, with additions of static typing and more object-oriented APIs, enums, etc. - -- eTS: a superset of TypeScript and the programming language for OpenHarmony ArkUI development, which powers UI development through a declarative development paradigm. +For details, see [XML-to-JavaScript Conversion](../reference/apis/js-apis-convertxml.md). ## How do I convert the time to the HHMMSS format? @@ -93,4 +90,5 @@ export default class DateTimeUtil{ return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}` } } + ``` -- GitLab