Smart android runtime permission manager written in kotlin language.
Mostly used and tested in Prague based android develpoment company - Quanti.
Do not use it right now. There might be bugs inside because of new android versions.
- Usable in every JVM language including Java/Kotlin/Scala ...
- Very easy to use
- Lightweight
- Sample app is ready to build
- Need static access to activity
Usage is simple
- Add all your desired permissions to manifest
<manifest ...>
<uses-permission android:name="android.permission.READ_CALENDAR"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
...
</manifest>
- Add some code to your static activity
override fun onCreate(savedInstanceState: Bundle?) {
BasePermission.setActivity(this)
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
BasePermission.propagatePermissionResult(requestCode, permissions, grantResults)
}
- Then select appropriate instance based on permission class and ask for permission or check status
if (ContactsPermission.permissionState == DECLINED){
ContactsPermission.requestPermission(this)
}
if (ContactsPermission.permissionGranted())
Follow this STEPS.
- send your requests