Skip to content

@capgo/capacitor-android-usagestatsmanager

Access Android usage statistics to track app usage time and screen time analytics

Access Android usage statistics to track app usage time and screen time analytics

Start with queryAndAggregateUsageStats() and the other core methods listed below.

PlatformSupportNotes
iOSYesNative
AndroidYesNative
WebNoGuard with Capacitor.getPlatform()
  • queryAndAggregateUsageStats - Queries and aggregates usage stats for the given time range.
  • isUsageStatsPermissionGranted - Checks if the usage stats permission is granted.
  • openUsageStatsSettings - Open the usage stats settings screen. This will open the usage stats settings screen, which allows the user to grant the usage stats permission. This will always open the settings screen, even if the permission is already granted.
  • queryAllPackages - Queries all installed packages on the device. Requires the QUERY_ALL_PACKAGES permission.
MethodDescription
queryAndAggregateUsageStatsQueries and aggregates usage stats for the given time range.
isUsageStatsPermissionGrantedChecks if the usage stats permission is granted.
openUsageStatsSettingsOpen the usage stats settings screen. This will open the usage stats settings screen, which allows the user to grant the usage stats permission. This will always open the settings screen, even if the permission is already granted.
queryAllPackagesQueries all installed packages on the device. Requires the QUERY_ALL_PACKAGES permission.
getPluginVersionGet the native Capacitor plugin version.

This reference is synced from src/definitions.ts in capacitor-android-usagestatsmanager.

Keep going from @capgo/capacitor-android-usagestatsmanager

Section titled “Keep going from @capgo/capacitor-android-usagestatsmanager”

If you are using @capgo/capacitor-android-usagestatsmanager to plan native plugin work, connect it with Using @capgo/capacitor-android-usagestatsmanager for the native capability in Using @capgo/capacitor-android-usagestatsmanager, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, and Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives.