Wrapper around the android Camera class that simplifies its usage

Related tags

Camera EasyCamera
Overview

EasyCamera

Wrapper around the android Camera class that simplifies its usage (read more about the process)

Usage:

// the surface where the preview will be displayed
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
EasyCamera camera = DefaultEasyCamera.open();
CameraActions actions = camera.startPreview(surfaceView.getHolder());
PictureCallback callback = new PictureCallback() {
    public void onPictureTaken(byte[] data, CameraActions actions) {
        // store picture
    }
};
actions.takePicture(Callbacks.create().withJpegCallback(callback));

By default, preview stops when a picture is taken. If you want to restart preview, specify .withRestartPreviewAfterCallbacks(true) on the Callbacks object

If you need the android.hardware.Camera object, get it via camera.getRawCamera()

How to import in maven:

    <dependency>
        <groupId>net.bozho.easycamera</groupId>
        <artifactId>easycamera</artifactId>
        <version>0.0.1</version>
        <type>aar</type>
    </dependency>

How to import in gradle:

    compile 'net.bozho.easycamera:easycamera:0.0.1:aar@aar'
You might also like...
Instagram like Image Picker for Android
Instagram like Image Picker for Android

ImagePicker A simple Instagram like library to select images from the gallery and camera. Screenshot Usage For full example, please refer to the sampl

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

Android application to preview, record (MediaRecorder), and fetch each image from both front and rear cameras simultaneously
Android application to preview, record (MediaRecorder), and fetch each image from both front and rear cameras simultaneously

DuoCamera 🚀 Overview Android application to preview, record (MediaRecorder) and fetch each image from both front and rear cameras simultaneously. The

 Bootcamp - Digital Innovation One e NTT Data - Aula de Recursos Nativos do Android
Bootcamp - Digital Innovation One e NTT Data - Aula de Recursos Nativos do Android

Recursos-Nativos-Android -Foto e Camera Bootcamp - Digital Innovation One e NTT Data - Aula de Recursos Nativos do Android Tutorial de uso da bibliote

Snappy - an android camerax library for taking snapshot fast & simple
Snappy - an android camerax library for taking snapshot fast & simple

Snappy is an android camerax library for taking snapshot fast & simple. Easy to integrate, 100% Kotlin & jetpack compose driven.

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

 App usage tracker which maps your app usage to geo location.
App usage tracker which maps your app usage to geo location.

Guilt Guilt is an inspiration from Meta (pun intended), it tracks the apps usage and maps it with geo location data where the app was last used. The a

This repository contains RabbitMQ Protobuf starters with its usage samples for spring-rabbit and spring-cloud-starter-stream-rabbit modules

This repository contains RabbitMQ Protobuf starters with its usage samples for spring-rabbit and spring-cloud-starter-stream-rabbit modules

Camera Folder:
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.

A TextView that automatically fit its font and line count based on its available size and content
A TextView that automatically fit its font and line count based on its available size and content

AutoFitTextView A TextView that automatically fit its font and line count based on its available size and content This code is heavily based on this S

Annotation Processing Library. Generates proxy class on top of interface/abstract class, that allows to intercept calls. Also known as a design pattern: proxy, delegate, interceptor.
Annotation Processing Library. Generates proxy class on top of interface/abstract class, that allows to intercept calls. Also known as a design pattern: proxy, delegate, interceptor.

1. AutoProxy Annotation Processing Library. Generates proxy class on top of interface/abstract class, that allows to intercept calls. Also known as a

Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any type of design pattern

What is Kotlin Extension Function ? Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any ty

Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime
Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime

TodoApp Android: An Android Sample App This Android Studio project wraps the Desktop Sample App to run on an Android phone. How to build & run Install

A wrapper around Android's SQLiteDatabase with restoring capability

Restorable SQLiteDatabase RestorableSQLiteDatabase is a wrapper to replicate android's SQLiteDatabase class with restoring capability. This wrapper ma

Android Java wrapper around ffmpeg command line binary

FFMPEG Library for Android This project is a Java wrapper around an ffmpeg command line binary for use in Android applications. It depends on the andr

A wrapper around Android's SQLiteDatabase with restoring capability

Restorable SQLiteDatabase RestorableSQLiteDatabase is a wrapper to replicate android's SQLiteDatabase class with restoring capability. This wrapper ma

A lightweight Kotlin friendly wrapper around Couchbase lite for Android.

CouchBaseKtx 🚧 Work In-Progress 🚧 A lightweight Kotlin friendly wrapper around Couchbase-lite for Android Read up a little bit of documentation abou

A lightweight wrapper around SQLiteOpenHelper which introduces reactive stream semantics to SQL operations.

SQL Brite A lightweight wrapper around SupportSQLiteOpenHelper and ContentResolver which introduces reactive stream semantics to queries. Deprecated T

A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.

MaterialDrawerKt Create navigation drawers in your Activities and Fragments without having to write any XML, in pure Kotlin code, with access to all t

Comments
  • Black Screen

    Black Screen

    Hello! when I call startPreview on the onCreate method of an activity or a fragment, the surface becomes black (but my webcam turns on the led indicating it's on) it only works when i call startPreview on a click of a button or something that will happen on a later time.. How can I fix that?

    opened by rafaelcorreiapoli 3
  • Camera is Freezing

    Camera is Freezing

    After i open easycamera class, i get preview of the camera but camera is freezing.

    public class MakePhotoActivity extends Activity {

    SurfaceHolder previewHolder;
    SurfaceView mSurfaceView;
    private boolean previewIsRunning;
    private EasyCamera camera;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    
        mSurfaceView = (SurfaceView) findViewById(R.id.surface);
        previewHolder = mSurfaceView.getHolder();
        previewHolder.addCallback(new SurfaceHolder.Callback() {
    
            public void surfaceChanged(SurfaceHolder holder, int format,
                    int width, int height) {
                 if (!previewIsRunning && (camera != null)) {
                     try {
                        camera.startPreview(holder);
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                     previewIsRunning = true;
                 }
            }
    
            public void surfaceCreated(SurfaceHolder holder) {
    
                camera = DefaultEasyCamera.open(CameraInfo.CAMERA_FACING_FRONT);
    
            }
    
            public void surfaceDestroyed(SurfaceHolder holder) { 
                camera.close();
                camera = null;
    
            }
    
        });
    }
    

    }

    opened by enversalih 3
Owner
Bozhidar Bozhanov
Bozhidar Bozhanov
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 Nov 22, 2022
📸 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 119 Nov 25, 2022
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 73 May 20, 2022
Android camera and serial communication utility that interacts with another device via a USB connection.

PVIT-Payload-Source Android camera and serial communication utility that interacts with another device via a USB connection. PVIT = Palos Verdes Insti

Zeroz & Onez 1 Nov 10, 2021
An Android App that uses Machine Learning to recognize the objects in an image captured from the phone's camera

Camera App ?? Description An Android App that uses Machine Learning (ML) to recognize the objects in an image captured from the phone's camera. • Allo

Shikeya Anderson 1 Dec 31, 2022
NguyenThienAn06105 - This repository consist of the code to read camera data on ESP8266 and a simple Android application to visualize the …

MLX90640-HeatCamera This repository consist of the code to read camera data on ESP8266 and a simple Android application to visualize the result. There

Christian Hein 0 Jan 1, 2022
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 81 Jun 29, 2022
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 644 Jan 7, 2023
A new camera app for GrapheneOS based on the modern CameraX library.

This is the new GrapheneOS Camera app based on Android's modern CameraX library. It's currently in the alpha phase and isn't yet included in GrapheneO

GrapheneOS 513 Jan 1, 2023