{"id":13428710,"url":"https://github.com/tajchert/Nammu","last_synced_at":"2025-03-16T01:32:58.798Z","repository":{"id":33195193,"uuid":"36837477","full_name":"tajchert/Nammu","owner":"tajchert","description":"Permission helper for Android M - background check, monitoring and more","archived":false,"fork":false,"pushed_at":"2022-04-18T01:01:29.000Z","size":457,"stargazers_count":710,"open_issues_count":7,"forks_count":75,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-03-09T06:34:30.616Z","etag":null,"topics":["android","callbackhell","monitor-permissions","runtime-permissions"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tajchert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-04T00:03:57.000Z","updated_at":"2024-10-25T16:08:46.000Z","dependencies_parsed_at":"2022-08-17T21:45:33.125Z","dependency_job_id":null,"html_url":"https://github.com/tajchert/Nammu","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tajchert%2FNammu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tajchert%2FNammu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tajchert%2FNammu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tajchert%2FNammu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tajchert","download_url":"https://codeload.github.com/tajchert/Nammu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814905,"owners_count":20352037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","callbackhell","monitor-permissions","runtime-permissions"],"created_at":"2024-07-31T01:01:03.275Z","updated_at":"2025-03-16T01:32:58.367Z","avatar_url":"https://github.com/tajchert.png","language":"Kotlin","readme":"Nammu - Runtime Permission Helper\n=======\n[![](https://jitpack.io/v/tajchert/Nammu.svg)](https://jitpack.io/#tajchert/Nammu) [![](https://jitci.com/gh/tajchert/Nammu/svg)](https://jitci.com/gh/tajchert/Nammu)\n\nSpeed up your work with new Runtime Permissions introduced in Android 6.0 Marshmallow. This lib allows you to monitor permissions, check them in background and as well ask for a permission in easy way (callback).\n\n### What are Runtime Permissions?\nGoogle docs is [here](https://developer.android.com/training/permissions/requesting.html).\nTLDR: like old-loved permissions that were ask during installation but this time they are more dynamic (should be ask only when they are needed) and can be revoked by user at any time.\n\n\u003cimg src=\"image/screenshot.png\" width=\"400\" height=\"672\" alt=\"Source of all evil\"/\u003e\n\n### Why should I care?\nBecause your user can revoke most essential part of your app and quite probably there will be a lot of app crashes.\nCurrent solution you can see here - [Google sample](https://github.com/googlesamples/android-RuntimePermissions) basically there is a lot that happens with Activity that is used to check and grant permissions. Also permissions rights are checked many times in the code.\n\n### Monitor permissions\nTo keep track of access to particular permissions, all you need is init Nammu `Nammu.init(Context);` (pass Application Context, not Activity Context) and call `permissionCompare(PermissionListener)` to compare lists of granted permissions with previous method call. If you want only to update granted permission lists (without checking if anything changed) use `refreshMonitoredList()`. PermissionListener offers a callback when permissions was changed, removed, or added. It is recommended to do on app start to check if user didn't removed any permissions and open our app again.\n\nAlso you can add Permission to ignored list to ignore its changes in access - use `ignorePermission(String permission)`.\n\n\n### Easy asking for permissions\nIt removes a bit of boiler plate to keep request id, and thus simplify your code inside Activity class.\ncall `Nammu.askForPermission(Activity, PermissionString , PermissionCallback)` which offers a nice callback with either success or fail method. To use this only thing you need to add is in your Activity that you are using.\n\n```java\n@Override\npublic void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {\n    Nammu.onRequestPermissionsResult(requestCode, permissions, grantResults);\n}\n```\n\n### Extras\nYou can get list of monitored Permissions -`Nammu.getPrevPermissions()`, list of currently granted permissions - `getGrantedPermissions()`, and few less important.\n\n### How to import it?\nIt is available on jitpack.io by adding this to your build.gradle:\n\n```groovy\nrepositories {\n    maven {\n        url \"https://jitpack.io\"\n    }\n}\n\ndependencies {\n    compile 'com.github.tajchert:nammu:1.5.1'\n}\n```\n### AndroidX, Kotlin...\nAndroid X was added in 1.3.0, last build without it is 1.2.4, Kotlin since 1.4.0.\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftajchert%2FNammu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftajchert%2FNammu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftajchert%2FNammu/lists"}