diff --git a/en/application-dev/faqs/Readme-EN.md b/en/application-dev/faqs/Readme-EN.md new file mode 100644 index 0000000000000000000000000000000000000000..9b471deb0bba59cdb42ee3edce2ab8f04a8982f7 --- /dev/null +++ b/en/application-dev/faqs/Readme-EN.md @@ -0,0 +1,6 @@ +# FAQs + +- [File Management Development](faqs-file-management.md) + +- [Data Management Development](faqs-data-management.md) + diff --git a/en/application-dev/faqs/faqs-data-management.md b/en/application-dev/faqs/faqs-data-management.md new file mode 100644 index 0000000000000000000000000000000000000000..839514879b8198273bc86680614b6b2054f662e2 --- /dev/null +++ b/en/application-dev/faqs/faqs-data-management.md @@ -0,0 +1,24 @@ +# Device Management Development + + + +## How Do I Save PixelMap data to a database? + +Applicable to: OpenHarmony SDK 3.2.3.5 + +You can convert a **PixelMap** into a **ArrayBuffer** and save the **ArrayBuffer** to your database. + +Reference: [readPixelsToBuffer](../reference/apis/js-apis-image.md#readpixelstobuffer7-1) + +## How Do I Obtain RDB Store Files? + +Applicable to: OpenHarmony SDK 3.2.3.5, stage model of API version 9 + +Run the hdc_std command to copy the .db, .db-shm, and .db-wal files from **/data/app/el2/100/database/Bundle name/entry/db/**, and then use the SQLite tool to open the files. + +Example: + + +``` + hdc_std file recv /data/app/el2/100/database/com.xxxx.xxxx/entry/db/test.db ./test.db +``` diff --git a/en/application-dev/faqs/faqs-file-management.md b/en/application-dev/faqs/faqs-file-management.md new file mode 100644 index 0000000000000000000000000000000000000000..1e3740047768d5d5fefa1420659c64da403ad587 --- /dev/null +++ b/en/application-dev/faqs/faqs-file-management.md @@ -0,0 +1,36 @@ +# File Management Development + + + +## What If There is No Return Value or Error Captured After getAlbums Is Called? + +Applicable to: OpenHarmony SDK 3.2.5.3, stage model of API version 9 + +The **ohos.permission.READ_MEDIA** permission is required for calling **getAlbums**, and this permission needs user authorization. For details, see OpenHarmony [Application Permission List](../security/permission-list.md). + +1. Configure the required permission in the **module.json5** file. + + ``` + "requestPermissions": [ + { + "name": "ohos.permission.READ_MEDIA" + } + ] + ``` + +2. Add the code for user authorization before the **MainAbility.ts -> onWindowStageCreate** page is loaded. + + ``` + private requestPermissions() { + let permissionList: Array = [ + "ohos.permission.READ_MEDIA" + ]; + this.context.requestPermissionsFromUser(permissionList) + .then(data => { + console.info(`request permission data result = ${data.authResults}`) + }) + .catch(err => { + console.error(`fail to request permission error:${err}`) + }) + } + ```