Name Date Size

..25-Oct-20244 KiB

.gitignoreH A D25-Oct-202456

AppScope/H25-Oct-20244 KiB

build-profile.json5H A D25-Oct-20241.1 KiB

entry/H25-Oct-20244 KiB

hvigor/H25-Oct-20244 KiB

hvigorfile.jsH A D25-Oct-2024168

hvigorwH A D25-Oct-20242.1 KiB

hvigorw.batH A D25-Oct-20242 KiB

oh-package.json5H A D25-Oct-2024819

ohosTest.mdH A D25-Oct-2024628

README.mdH A D25-Oct-20242.9 KiB

README_zh.mdH A D25-Oct-20245 KiB

screenshots/device/H25-Oct-20244 KiB

README.md

1# Storage Space Statistics
2
3### Introduction
4
5This sample presents how to view the storage space usage, space of all installed applications, and available volumes of a device by using the application bundle management, application space statistics, and volume management modules.
6
7This sample uses the [<**DataPanel** component>](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md) to display the space information about different applications; uses [**Bundle**](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-Bundle.md) to obtain the application name and bundle information; uses [**App Space Statistics**](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-file-storage-statistics.md) to obtain the storage space usage of the device; use [**Volume Management**](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-file-volumemanager.md) to obtain information about available volumes of the device.
8Instructions:
9
101. The main page displays the detailed information about the storage space usage of the current device.
11
122. Tap **Application** to view the space of all installed applications.
13
143. Tap **View Available Volumes** to view information about all available volumes of the device.
15
16
17
18### Display Effect
19
20![](./screenshots/device/main_page_en.png)
21![](./screenshots/device/application_page_en.png)
22![](./screenshots/device/volume_page_en.png)
23
24### Required Permissions
25
26- Permission to obtain storage space information and available volumes: [ohos.permission.STORAGE_MANAGER](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/permission-list.md)
27
28- Permission to obtain information about installed applications: [ohos.permission.GET_BUNDLE_INFO_PRIVILEGED](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/permission-list.md)
29
30### Dependency
31
32N/A
33
34### Constraints
35
361. This sample can only be run on standard-system devices that use the Rockchip RK3568 development board.
37
382. This sample is based on the stage model, which is supported from API version 10 (API Version 10 Release). 
39
403. DevEco Studio (4.0 Release) must be used.
41
424. This sample uses the **@ohos.bundle.innerBundleManager**, **@ohos.volumeManager**, and **@ohos.storageStatistics** system APIs. To use the full SDK, obtain it from a mirror site and switch to it in DevEco Studio. For details, see [Guide to Switching to Full SDK](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/).
43
445. This example uses the **system_core** permissions (see [App Permission List](https://gitee.com/openharmony/docs/blob/master/en/application-dev/security/permission-list.md)). You need to [configure a high-level permission signature](https://docs.openharmony.cn/pages/v3.2/en/application-dev/security/hapsigntool-overview.md/).
45