diff --git a/en/application-dev/faqs/faqs-development-board.md b/en/application-dev/faqs/faqs-development-board.md index 4766d4f5271dec2e5ec937477cf1ce1b7946eef6..79e5fc390f934f82eb3d70468f9ed41faed68947 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 5bb748f758a4636fb40ae5d7fb741eccfb5306fe..dd836eb11abfbee3979f5a604eb5aa734d0d9112 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 7d4ae1dcb80b63a4632e3a30627ff53f37e63c37..c60ff729eae773a356a50da1b9197c1de2b9c120 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)}` } } + ```