android_package_manager 0.7.1 copy "android_package_manager: ^0.7.1" to clipboard
android_package_manager: ^0.7.1 copied to clipboard

PlatformAndroid

Provides access to Android's native PackageManager API to fetch various information, such as installed applications, packages, permissions, etc.

android_package_manager Pub #

Provides access to Android's native PackageManager API to fetch various information, such as installed applications, packages, permissions, etc.

About this Package #

This plugin is purposed for Android use only. Allowing easier access to most commonly used methods of Android's PackageManager API. Adapted a few methods from existing package package_manager which seems not to be maintained recently.

Getting Started #

Importing:

import package:android_package_manager/android_package_manager.dart;

Singleton access example:

final pm = AndroidPackageManager();

Available Methods #

Please see official documentation of PackageManager API.
Disclaimer: I have been trying to adapt most of the available methods. Done with some simple instrumentation tests.
Tested methods can be found under example/integration_test directory.

Example Flutter app demonstrates the getInstalledPackages method.

Side Notes #

Please take note of the flags optional argument on some of the methods. These will affect the output of the request to the APIs. For example, PackageInfo won't show any permissions info if the flag for GET_PERMISSIONS is not specified.

Optional permissions #

By default, the list of installed apps is limited on Android 11 (API level 30) and higher. Read more about it here. To access the full list of apps installed on a device, add the following permission to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

TO-DOs #

  • Proper documentation
  • DartDocs
  • Adjusting some methods to be Android Tiramisu compatible (deprecating some methods)
  • Documenting bitmask values
  • Separating interfaces into a separate package (maybe)

Issues #

Feel free to file issues or any suggestions here

10
likes
120
pub points
88%
popularity

Publisher

unverified uploader

Provides access to Android's native PackageManager API to fetch various information, such as installed applications, packages, permissions, etc.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on android_package_manager