android_package_manager

Creator: coderz1093

Last updated:

Add to Cart

Description:

android package manager

android_package_manager #
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;
copied to clipboard
Singleton access example:
final pm = AndroidPackageManager();
copied to clipboard
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" />
copied to clipboard
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

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.