Image Picker library for Android

Overview

Ronnie-Image-Picker

Asks for Camera and storage permission and return uri of the images taken or picked from the gallery.

Min Api Level: 16

Build System : Gradle

Getting started

You don't need to declare the permissions in the manifests.

Add this in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
       maven { url 'https://jitpack.io' }
    }
}

Add this to dependencies:

dependencies {
	     implementation 'com.github.ronnieotieno:Ronnie-Image-Picker:0.3.0' //Add latest version
	}

Example in code, Kotlin:

 //activity
  val imagePicker = ImagePicker(this)
  
  //fragment
   val imagePicker = ImagePicker(requireActivity())

    //Camera
            imagePicker.takeFromCamera(object : ImageResult {
                override fun onFailure(reason: String) {
                    Toast.makeText(this, reason, Toast.LENGTH_LONG).show()
                }

                override fun onSuccess(uri: Uri) {
                    imageView.setImageURI(uri)
                }
            })
     
     //Gallery
            imagePicker.pickFromStorage(object : ImageResult {
                override fun onFailure(reason: String) {
                    Toast.makeText(this, reason, Toast.LENGTH_LONG).show()
                }

                override fun onSuccess(uri: Uri) {
                    imageView.setImageURI(uri)
                }
            })
        

Example in code,Java:

 //activity
 ImagePicker imagePicker = new ImagePicker(this);
 
 //fragment
 ImagePicker imagePicker = new ImagePicker(requireActivity());
       
       //Gallery
       imagePicker.pickFromStorage(new ImageResult() {
           @Override
           public void onSuccess(@NotNull Uri uri) {
               imageView.setImageURI(uri);
           }

           @Override
           public void onFailure(@NotNull String s) {

           }
       });
       
       //Camera
       imagePicker.takeFromCamera(new ImageResult() {
           @Override
           public void onSuccess(@NotNull Uri uri) {
               imageView.setImageURI(uri);
           }

           @Override
           public void onFailure(@NotNull String s) {

           }
       });
Issues
  • Develop

    Develop

    Added Constructor overloading to make work easier while initialising from a fragment or activity

    opened by oyamo 2
  • Develop

    Develop

    opened by oyamo 2
Releases(0.8.0)
Owner
Ronnie Otieno
Android - Kotlin/Java. Learning more. Also Google certified AAD.
Ronnie Otieno
Image Picker library for Android

Ronnie-Image-Picker Asks for Camera and storage permission and return uri of the images taken or picked from the gallery. Min Api Level: 16 Build Syst

Ronnie Otieno 16 Sep 9, 2021
Android library to choose image from gallery or camera with option to compress result image

ImagePicker Android library to choose image from gallery or camera with option to compress result image. Download Add this to your project's build.gra

Mayank Nagwanshi 63 Sep 6, 2021
Camera Folder: "Take a Photo from Camera" everywhere where you can open a photo file

When "Camera Folder" is installed many Android-Apps that can open jpg files can also take a photo from camera.

k3b 7 Sep 14, 2021
A library to take picture easy, transform your data in different format and save photos in your device

A Magic library to take photos and select pictures in Android. In a simple way and if you need it also save the pictures in device, and facial recogni

Fabian Rosales (Frosquivel Developer) 329 Sep 5, 2021
📸 Use Android camera to take pictures and videos, based on `camera2` api.

Camera Use Android camera to take pictures and videos, based on camera2 api. Features Auto filled CameraView for previewing Support both image capture

Hong Duan 112 Aug 15, 2021
Quick photo and video camera with a flash, customizable resolution and no ads.

Simple Camera A camera with flash, zoom and no ads. The camera is usable for both photo taking and video recording. You can switch between front and r

Simple Mobile Tools 552 Sep 18, 2021
Powerful custom Android Camera with granular control over the video quality and filesize, restricting recordings to landscape only.

LandscapeVideoCamera Highly flexible Android Camera which offers granular control over the video quality and filesize, while restricting recordings to

Jeroen Mols 1.2k Sep 12, 2021
Measures human heart rate using camera and flash light.

Heart-Rate-Ometer Introduction Measures human heart rate using camera and flash light. How-it-works https://github.com/phishman3579/android-heart-rate

Jan Rabe 78 Jul 29, 2021
📸 A library that allows you to capture images secretly, in background without alerting users.

HiddenCamera A library that allows you to capture images secretly, in background without alerting users. Gradle Dependency Add the dependency to your

Cotta & Cush Limited 105 Sep 18, 2021
Wrapper around the android Camera class that simplifies its usage

EasyCamera Wrapper around the android Camera class that simplifies its usage (read more about the process) Usage: // the surface where the preview wil

Bozhidar Bozhanov 646 Aug 3, 2021