Storage Space Statistics
Introduction
This 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.
This sample uses the <DataPanel component> to display the space information about different applications; uses Bundle to obtain the application name and bundle information; uses App Space Statistics to obtain the storage space usage of the device; use Volume Management to obtain information about available volumes of the device. Instructions:
-
The main page displays the detailed information about the storage space usage of the current device.
-
Tap Application to view the space of all installed applications.
-
Tap View Available Volumes to view information about all available volumes of the device.
Display Effect

Required Permissions
-
Permission to obtain storage space information and available volumes: ohos.permission.STORAGE_MANAGER
-
Permission to obtain information about installed applications: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
Dependency
N/A
Constraints
-
This sample can only be run on standard-system devices that use the Rockchip RK3568 development board.
-
This sample is based on the stage model, which is supported from API version 10 (API Version 10 Release).
-
DevEco Studio (4.0 Release) must be used.
-
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.
-
This example uses the system_core permissions (see App Permission List). You need to configure a high-level permission signature.