device_policy_manager
1.0.0, released 2 years ago by iheb.tech
Query and manage Android device administrator policies and lock the screen.
What it does
Allows Flutter apps to interact with the Android DevicePolicyManager. It enables requesting device administrator permissions, locking the device immediately, checking permission status, removing admin privileges, and checking camera status.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to lock the Android device programmatically from your app.
- Your application requires Android device administrator privileges.
Skip it when
- You are building for iOS or other platforms not supporting Android DevicePolicyManager.
- You do not want to prompt the user for device administrator permissions.
Strengths
- Provides straightforward methods to lock the screen and manage admin permissions.
- Simple integration via static methods.
Weaknesses
- Limited to Android platform.
- Requires manual configuration of native AndroidManifest.xml and policies.xml files.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Requires adding a receiver to AndroidManifest.xml and creating a policies.xml file inside res/xml.
final status = await DevicePolicyManager.isPermissionGranted();
await DevicePolicyManager.requestPermession("Your app is requesting the Adminstration permission");
await DevicePolicyManager.lockNow();Alternatives
Packages that do the same job and could replace device_policy_manager.
- open_mail
Query device for installed email apps and open them programmatically.
58Compare - open_mail_app_plus
Query device for installed email apps and open them or present a picker.
54Compare - platform_device_id
Get unique device IDs across Android, iOS, Windows, Linux, macOS, and Web.
50Compare - open_mail_app
Query the device for installed email apps and open them.
30Compare