sandriosCamera

Additional

Language
Java
Version
1.1.0 (Nov 24, 2017)
Created
Dec 25, 2016
Updated
Oct 29, 2018
Owner
sandrios studios (sandrios)
Contributors
Arpit Gandhi (arpitgandhi9)
arpitignite
Mackaber
3
Activity
Badge
Generate
Download
Source code

Announcement

sandriosCamera

Camera Library for Android

sandrios camera allows developers to integrate image and video capturing without dealing with the complicated camera APIs.

It includes image picker interface inside the cameraview enabling the user to access recent media from inside the camera module.

Download

You can download an aar from GitHub's releases page.

Or use Gradle:

repositories {
   jcenter()
}

dependencies {
  compile 'com.sandrios.android:sandriosCamera:1.1.0'
}

Or Maven:

<dependency>
  <groupId>com.sandrios.android</groupId>
  <artifactId>sandriosCamera</artifactId>
  <version>1.1.0</version>
  <type>pom</type>
</dependency>

If you are planning to include the library as a module, then you will have to upgrade to Android Studio 3.0

ProGuard

Depending on your ProGuard (DexGuard) config and usage, you may need to include the following lines in your proguard.cfg

-keep public class com.sandrios.** { *; }

-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
    public <init>(android.content.Context);
}

-dontwarn android.support.**

#Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

#uCrop
-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }

-keepattributes *Annotation*
-keepclassmembers class ** {
    @com.squareup.otto.Subscribe public *;
    @com.squareup.otto.Produce public *;
}

#RxJava
-keep class rx.schedulers.Schedulers {
    public static <methods>;
}
-keep class rx.schedulers.ImmediateScheduler {
    public <methods>;
}
-keep class rx.schedulers.TestScheduler {
    public <methods>;
}
-keep class rx.schedulers.Schedulers {
    public static ** test();
}
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
    long producerIndex;
    long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
    rx.internal.util.atomic.LinkedQueueNode producerNode;
    rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
-keep class com.google.**
-dontwarn com.google.**
-dontwarn sun.misc.**

How do I use Sandrios Camera?

Please check the sample project included for more examples:

  private static final int CAPTURE_MEDIA = 368;

  // showImagePicker is boolean value: Default is true
  // setAutoRecord() to start recording the video automatically if media action is set to video.
  private void launchCamera() {
     SandriosCamera
        .with(activity)
        .setShowPicker(true)
        .setShowPickerType(CameraConfiguration.VIDEO)
        .setVideoFileSize(20)
        .setMediaAction(CameraConfiguration.MEDIA_ACTION_BOTH)
        .enableImageCropping(true)
        .launchCamera(new SandriosCamera.CameraCallback() {
            @Override
            public void onComplete(CameraOutputModel model) {
                Log.e("File", "" + model.getPath());
                Log.e("Type", "" + model.getType()); //Check SandriosCamera.MediaType
                Toast.makeText(getApplicationContext(), "Media captured.", Toast.LENGTH_SHORT).show();
            }
        });  
    }

Status

  • Flash Mode (Testing Needed)

Comments/bugs/questions/pull requests are always welcome!

Compatibility

  • Android SDK: Sandrios Camera requires a minimum API level of 14.

Download

You may also find precompiled aar on the releases page.

Getting Help

To report a specific problem or feature request, open a new issue on Github. For questions, suggestions, or anything else -- github@sandrios.com

Thanks

  • Glide for the Image Loading Framework
  • Dexter for the Permission Management in Android 23+
  • uCrop for the Image Cropping
  • Everyone who has contributed code and reported issues!

Author

sandrios studios - @sandrios on GitHub

License

MIT. See the LICENSE file for details.