All Projects → fondesa → Kpermissions

fondesa / Kpermissions

Licence: apache-2.0
A Kotlin library which helps to request runtime permissions in Android.

Programming Languages

kotlin
9241 projects
flow
126 projects

Projects that are alternatives of or similar to Kpermissions

Fountain
Android Kotlin paged endpoints made easy
Stars: ✭ 175 (-30.83%)
Mutual labels:  rxjava, rxjava2, coroutines, livedata
Sunset-hadith
Islamic app written with Kotlin, using KTOR + coroutines + flow + MVVM + Android Jetpack + Navigation component. Old version using RxJava + Retrofit + OKHttp
Stars: ✭ 26 (-89.72%)
Mutual labels:  coroutines, rxjava2, livedata
Rxpermission
Reactive permissions for Android
Stars: ✭ 182 (-28.06%)
Mutual labels:  rxjava, rxjava2, permissions
Powerpermission
Android Permission lib PowerPermission makes handling runtime permissions extremely easy.
Stars: ✭ 103 (-59.29%)
Mutual labels:  rxjava2, coroutines, livedata
eyepetizer kotlin
一款仿开眼短视频App,分别采用MVP、MVVM两种模式实现。一、组件化 + Kotlin + MVP + RxJava + Retrofit + OkHttp 二、组件化 + Kotlin + MVVM + LiveData + DataBinding + Coroutines + RxJava + Retrofit + OkHttp
Stars: ✭ 83 (-67.19%)
Mutual labels:  coroutines, rxjava2, livedata
Mvvm Architecture Android Beginners
This repository contains a sample app that implements MVVM architecture using Kotlin, ViewModel, LiveData, and etc.
Stars: ✭ 176 (-30.43%)
Mutual labels:  rxjava, rxjava2, livedata
Rxbus
Event Bus By RxJava.
Stars: ✭ 2,126 (+740.32%)
Mutual labels:  rxjava, rxjava2
Androidbasemvp
🚀一个快速搭建MVP+RxJava2+Retrofit 基础框架,主要是封装有Http网络请求、日志、缓存、加载等待、toast、页面状态布局管理、权限、RxBus、Glide图片加载等组件,方便快速开发新项目、减少开发成本。
Stars: ✭ 184 (-27.27%)
Mutual labels:  rxjava, rxjava2
Android Mvvm Architecture
This repository contains a detailed sample app that implements MVVM architecture using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 2,720 (+975.1%)
Mutual labels:  rxjava, rxjava2
Wanandroid
Kotlin+JetPack+协程实现的MVVM架构Wanandroid客户端
Stars: ✭ 197 (-22.13%)
Mutual labels:  coroutines, livedata
Newsapp
A Sample News App written in Kotlin using Android Architecture Components, MVVM
Stars: ✭ 179 (-29.25%)
Mutual labels:  rxjava2, livedata
Reactivewifi
Android library listening available WiFi Access Points and related information with RxJava Observables
Stars: ✭ 186 (-26.48%)
Mutual labels:  rxjava, rxjava2
Rxble
使用 RxJava 封装的低功耗蓝牙类库
Stars: ✭ 203 (-19.76%)
Mutual labels:  rxjava, rxjava2
Httprequest
基于Retrofit2+RxJava2+OkHttp3的网络请求框架,可以完美的应用到组件化、MVP模式等项目中
Stars: ✭ 181 (-28.46%)
Mutual labels:  rxjava, rxjava2
Mvvmtemplate
An Android Template with MVVM and Clean Architecture
Stars: ✭ 182 (-28.06%)
Mutual labels:  rxjava2, coroutines
Trailersapp
A simple demo project for The Movie DB based on MVVM clean architecture.
Stars: ✭ 180 (-28.85%)
Mutual labels:  rxjava2, livedata
Eazypermissions
Android library to handle runtime permission through Kotlin coroutines and Livedata.
Stars: ✭ 192 (-24.11%)
Mutual labels:  coroutines, livedata
Reactivenetwork
Android library listening network connection state and Internet connectivity with RxJava Observables
Stars: ✭ 2,484 (+881.82%)
Mutual labels:  rxjava, rxjava2
Rxfit
🏃Reactive Fitness API Library for Android and RxJava
Stars: ✭ 218 (-13.83%)
Mutual labels:  rxjava, rxjava2
Jethub
Sample App with Jetpack components(LiveData, Navigation, ViewModel) + MVVM + coroutine + single activity
Stars: ✭ 224 (-11.46%)
Mutual labels:  coroutines, livedata

KPermissions

Build Status KPermissions

An Android library totally written in Kotlin that helps to request runtime permissions. This library is compatible also below Android M (API 23) where runtime permissions doesn't exist, so you haven't to handle them separately.

Usage

To discover all the APIs of this library, check the wiki. It contains some useful notes and advanced features not explained in the README. For further samples, check the sample provided by this library. It shows how to integrate this library and request the permissions from an Activity or a Fragment.

Basic usage

You can create a PermissionRequest either from an Activity or a Fragment using the extension method permissionsBuilder():

// Build the request with the permissions you would like to request and send it.
permissionsBuilder(Manifest.permission.CAMERA, Manifest.permission.SEND_SMS).build().send { result ->
    // Handle the result, for example check if all the requested permissions are granted.
    if (result.allGranted()) {
       // All the permissions are granted.
    }
}

Coroutines

The artifact kpermissions-coroutines adds the integration with the Kotlin coroutines:

launch {
    val result = permissionsBuilder(Manifest.permission.CAMERA).build().sendSuspend()
    // Handle the result.
}

It also supports the Kotlin coroutines Flow API:

val request = permissionsBuilder(Manifest.permission.CAMERA).build()
launch {
    request.flow().collect { result ->
        // Handle the result. 
    }
}
request.send()

RxJava

The artifacts kpermissions-rx2 and kpermissions-rx3 adds the integration with RxJava 2 and RxJava 3 respectively:

val request = permissionsBuilder(Manifest.permission.CAMERA).build()
request.observe().subscribe { result ->
    // Handle the result.
}
request.send()

LiveData

In the core artifact, there's a useful extension on PermissionRequest to get a LiveData:

val request = permissionsBuilder(Manifest.permission.CAMERA).build()
request.liveData().observe(this) { result ->
    // Handle the result.
}
request.send()

Compatibility

Android SDK: KPermissions requires a minimum API level of 14 (the same of the latest support libraries).

AndroidX: this library requires AndroidX. To use it in a project without AndroidX, refer to the version 1.x

Integration

You can download a jar from GitHub's releases page or grab it from mavenCentral().

Gradle

Maven Central

dependencies {
    // The core artifact.
    implementation 'com.github.fondesa:kpermissions:x.x.x'
    // If you want the extensions for RxJava 2.
    implementation 'com.github.fondesa:kpermissions-rx2:x.x.x'
    // If you want the extensions for RxJava 3.
    implementation 'com.github.fondesa:kpermissions-rx3:x.x.x'
    // If you want the extensions for the Kotlin coroutines.
    implementation 'com.github.fondesa:kpermissions-coroutines:x.x.x'
}

Contributing

Feel free to contribute to this project following the contributing guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].