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

!10041 PR8764合入beta 3分支

Merge pull request !10041 from Annie_wang/cherry-pick-1664268536
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
- [Environment Setup](faqs-environment-setup.md) - [Environment Setup](faqs-environment-setup.md)
- [Compilation and Building](faqs-building.md) - [Compilation and Building](faqs-building.md)
- [Burning](faqs-burning.md) - [Burning](faqs-burning.md)
- [File Management Development](faqs-file-management.md)
- [Data Management Development](faqs-data-management.md)
- [Kernel](faqs-kernel.md) - [Kernel](faqs-kernel.md)
- [Porting](faqs-porting.md) - [Porting](faqs-porting.md)
- [Startup](faqs-startup.md) - [Startup](faqs-startup.md)
......
# Data 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 an **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 in **/data/app/el2/100/database/*bundleName*/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 Should I Do 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 [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.
先完成此消息的编辑!
想要评论请 注册