A declarative annotation-based library for handling Android runtime permissions in Kotlin and Java.
PermissionsDispatcher is an open-source Android library that provides a declarative, annotation-based API for handling runtime permissions. It solves the problem of verbose and error-prone permission-checking code by generating the necessary logic at compile time, allowing developers to focus on app functionality instead of permission boilerplate.
Android developers building apps that require runtime permissions, particularly those using Kotlin or Java who want a type-safe, maintainable solution.
Developers choose PermissionsDispatcher because it offers a clean, reflection-free approach that reduces boilerplate, integrates seamlessly with Android lifecycle, and supports both Kotlin and Java with special permission handling.
A declarative API to handle Android runtime permissions.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses concise annotations like @RuntimePermissions and @NeedsPermission to declare permission requirements, drastically reducing boilerplate code as shown in the Kotlin example with generated methods like showCameraWithPermissionCheck.
Generates all permission-handling code at compile time, avoiding runtime reflection for better performance and safety, which is emphasized as a core feature in the README.
Handles tricky permissions like system overlay or write settings with specific annotations and documentation, making it easier to manage beyond standard runtime permissions.
Works seamlessly with both Kotlin (via kapt or ktx) and Java (via apt), offering flexibility for diverse codebases without sacrificing functionality.
Requires setting up kapt for Kotlin or apt for Java, which can slow down build times and add configuration complexity, especially in large projects.
Only supports Activities and Fragments, not other Android components like Services or ViewModels, forcing workarounds for broader use cases.
Has separate versions for Jetpack and appcompat (4.x vs 3.x), requiring careful migration and potentially causing compatibility issues, as noted in the installation section.