• Stars
    star
    713
  • Rank 63,511 (Top 2 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Permission helper for Android M - background check, monitoring and more

Nammu - Runtime Permission Helper

Speed 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).

What are Runtime Permissions?

Google docs is here. TLDR: 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.

Source of all evil

Why should I care?

Because your user can revoke most essential part of your app and quite probably there will be a lot of app crashes. Current solution you can see here - Google sample 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.

Monitor permissions

To 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.

Also you can add Permission to ignored list to ignore its changes in access - use ignorePermission(String permission).

Easy asking for permissions

It removes a bit of boiler plate to keep request id, and thus simplify your code inside Activity class. call 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.

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    Nammu.onRequestPermissionsResult(requestCode, permissions, grantResults);
}

Extras

You can get list of monitored Permissions -Nammu.getPrevPermissions(), list of currently granted permissions - getGrantedPermissions(), and few less important.

How to import it?

It is available on jitpack.io by adding this to your build.gradle:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    compile 'com.github.tajchert:nammu:1.5.1'
}

AndroidX, Kotlin...

Android X was added in 1.3.0, last build without it is 1.2.4, Kotlin since 1.4.0.

More Repositories

1

WaitingDots

Kotlin
739
star
2

BusWear

EventBus for Android Wear devices.
Java
257
star
3

ExceptionWear

A library for Android Wear projects to handle exceptions properly.
Java
102
star
4

NotificationResponse

Java
52
star
5

RuntimePermissionWorkshop

Android Runtime Permissions workshop.
Java
32
star
6

ShapeWear

One class example for simple detecting screen shape on Android Wear devices.
Java
27
star
7

Houston

Helper for managing notification stack - dismiss only part of notifications (category), by id (as usually), get list of active if possible and more.
Kotlin
24
star
8

SWear_Weather

Nothing fancy... just a weather clockface for AndroidWear
Java
13
star
9

Wearly

Android Wear watch face with Timely like style of animations.
Java
11
star
10

Faceboard

Google Cardboard app that uses OpenCV for Terminator style face detection.
Java
9
star
11

Glass_QRCards

Google Glass QR Codes reader, scan&store them.
Java
8
star
12

ServiceWear

Android Wear library to enable more than one WearableListenerService.
Java
7
star
13

DetectWear

Small library to detect if Android Wear device is connected to Android phone.
Java
7
star
14

Huawei-Mobile-Services-with-GPS

Sample integration of Huawei Mobile Services (HMS, Map Kit) for existing app with Google Mobile Services. This repo show how to create HMS flavour of your app and split GPS/HMS imports when using Android Architecture components (LiveData and ModelView).
Kotlin
7
star
15

Glass_Wallet

Expenses manager for keeping track of your finances, on Google Glass.
Java
6
star
16

AndroidWearScripts

ADB bash scripts to speed up work with Android Wear
Shell
6
star
17

LiveWatch

Android Wear watch face with background that depends on a accelerometer reading.
Java
4
star
18

RegistrationPlate

Java
3
star
19

FitSurvivor

Java
2
star
20

Glass_NumPad

Java
2
star
21

Glass_Keyboard

Java
2
star
22

WearBusinessCard

Java
2
star
23

SpritzerWear

A SpritzerTextView implementation for Android Wear.
Java
2
star
24

CEEHack

Central Open Data Hackathon ceehack.org
Java
2
star
25

Ender-5-Marlin

Precompiled Marlin firmware for Creality Ender 5
C++
1
star
26

MineWatcher

An app for Windows Phone (>7.1), to monitor Bitcoin miner at polmine.pl (other pools will be added in future).
C#
1
star
27

BiometricPromptSample

Sample of usage BiometricPrompt And BiometricPromptCompat
Kotlin
1
star
28

CheatWear

Java
1
star
29

WearWorkshops

Java
1
star
30

PlayerStatsGames

Java
1
star
31

WearBankCode

Android Wear app for handling bank code and displaying it on the Android Wear device
Java
1
star
32

securetime

Library for Roughtime protocol on Android. Superior to NTP protocol in terms of security. Based on Java library by int08h https://github.com/int08h/nearenough
Java
1
star
33

DevLiner

Java program to count number of code lines in your workspace, organize it into Projects and keep history of line number in each of them. After that it would generate WWW with charts so you can easily share it.
JavaScript
1
star