All Projects → OmarAflak → Android Camera2 Library

OmarAflak / Android Camera2 Library

Library to use Android Camera2 api easily.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android Camera2 Library

Image Comparison
Published on Maven Central and jCenter Java Library that compares 2 images with the same sizes and shows the differences visually by drawing rectangles. Some parts of the image can be excluded from the comparison. Can be used for automation qa tests.
Stars: ✭ 145 (+119.7%)
Mutual labels:  gradle, library
Liquidrefreshlayout
Liquid Refresh Layout is a simple SwipeToRefresh library that helps you easily integrate SwipeToRefresh and performs simple clean liquid animation
Stars: ✭ 114 (+72.73%)
Mutual labels:  gradle, library
Gradle Maven Plugin
Gradle 5.x Maven Publish Plugin to deploy artifacts
Stars: ✭ 124 (+87.88%)
Mutual labels:  gradle, library
Codeeditor
Code Editor Native Way
Stars: ✭ 155 (+134.85%)
Mutual labels:  gradle, library
Java Markdown Generator
Java library to generate markdown
Stars: ✭ 159 (+140.91%)
Mutual labels:  gradle, library
Let
Annotation based simple API flavored with AOP to handle new Android runtime permission model
Stars: ✭ 532 (+706.06%)
Mutual labels:  gradle, library
Animatefx
A library of +70 ready-to-use animations for JavaFX
Stars: ✭ 254 (+284.85%)
Mutual labels:  gradle, library
Candyview
Implement any RecyclerView in just 1 Line. CandyView handles everything for you.
Stars: ✭ 15 (-77.27%)
Mutual labels:  gradle, library
Dotsloaderview
Simple dots loader view
Stars: ✭ 63 (-4.55%)
Mutual labels:  library
Logging Log4j2
Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements available in Logback while fixing some inherent problems in Logback's architecture.
Stars: ✭ 1,133 (+1616.67%)
Mutual labels:  library
Best Of Web Python
🏆 A ranked list of awesome python libraries for web development. Updated weekly.
Stars: ✭ 1,118 (+1593.94%)
Mutual labels:  library
Align
A general purpose application and library for aligning text.
Stars: ✭ 63 (-4.55%)
Mutual labels:  library
Poi
Mirror of Apache POI
Stars: ✭ 1,136 (+1621.21%)
Mutual labels:  library
Fetch
The best file downloader library for Android
Stars: ✭ 1,124 (+1603.03%)
Mutual labels:  gradle
P5.clickable
Event driven, easy-to-use button library for P5.js 👆
Stars: ✭ 66 (+0%)
Mutual labels:  library
Roffildlibrary
Library for MQL5 (MetaTrader) with Python, Java, Apache Spark, AWS
Stars: ✭ 63 (-4.55%)
Mutual labels:  library
Whisper
Whisper is a file-based time-series database format for Graphite.
Stars: ✭ 1,121 (+1598.48%)
Mutual labels:  library
Dmxusb
DMXUSB emulates an ENTTEC-compatible DMXKing USB to DMX serial device with one, two, or n universes.
Stars: ✭ 66 (+0%)
Mutual labels:  library
Bubbles
⚡️A library for adding messenger style floating bubbles to any android application 📲
Stars: ✭ 66 (+0%)
Mutual labels:  library
Tus Java Server
Library to receive tus v1.0.0 file uploads in a Java server environment
Stars: ✭ 64 (-3.03%)
Mutual labels:  library

EZCam Download

EZCam is an Android library that simplifies the use of Camera 2 API for a basic usage.

Dependencie

Add the following line in your gradle dependencies :

compile 'me.aflak.libraries:ezcam:X.X'

Or if you use Maven :

<dependency>
  <groupId>me.aflak.libraries</groupId>
  <artifactId>ezcam</artifactId>
  <version>X.X</version>
  <type>pom</type>
</dependency>

TextureView

Important : The TextureView must be in a FrameLayout.

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextureView
    android:id="@+id/textureView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
</FrameLayout>

Initialize

EZCam cam = new EZCam(Context);
String id = cam.getCamerasList().get(CameraCharacteristics.LENS_FACING_BACK); // should check if LENS_FACING_BACK exist before calling get()
cam.selectCamera(id);

Callback

cam.setCameraCallback(new EZCamCallback() {
	@Override
	public void onCameraReady() {
		// triggered after cam.open(...)
		// you can set capture settings for example:
		cam.setCaptureSetting(CaptureRequest.COLOR_CORRECTION_ABERRATION_MODE, CameraMetadata.COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY);
		cam.setCaptureSetting(CaptureRequest.CONTROL_EFFECT_MODE, CameraMetadata.CONTROL_EFFECT_MODE_NEGATIVE);

		// then start the preview
		cam.startPreview();
	}

	@Override
	public void onPicture(Image image) {
		File file = new File(getFilesDir(), "image.jpg"); // internal storage
		File file = new File(getExternalFilesDir(null), "image.jpg") // external storage, need permissions
		EZCam.saveImage(image, file);
	}

	@Override
	public void onError(String message) {
		// all errors will be passed through this methods
	}

	@Override
	public void onCameraDisconnected() {
		// camera disconnected
	}
});

Open Camera

cam.open(CameraDevice.TEMPLATE_PREVIEW, textureView); // needs Manifest.permission.CAMERA

Take picture

cam.takePicture();

Close camera

@Override
protected void onDestroy() {
cam.close();
	super.onDestroy();
}

TODO

  • Recording videos
  • Apply custom filters

See MainActivity.java

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