未验证 提交 cf322e76 编写于 作者: O openharmony_ci 提交者: Gitee

!9450 [翻译完成】#I5NFOI

Merge pull request !9450 from Annie_wang/PR8343
# FAQs
- [File Management Development](faqs-file-management.md)
- [Data Management Development](faqs-data-management.md)
# 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
```
# 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<string> = [
"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}`)
})
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册