Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create camera preview using API 21 android?

Since API 21 google recommend using the new android.hardware.camera2 I tried to find examples of using new API to create camera preview, but nothing was found. Can any body give me an example? Thanks so much!

like image 577
TOP Avatar asked Dec 03 '14 09:12

TOP


People also ask

What is CameraX preview?

↳ androidx.camera.core.Preview. A use case that provides a camera preview stream for displaying on-screen. The preview stream is connected to the Surface provided via SurfaceProvider . The application decides how the Surface is shown, and is responsible for managing the Surface lifecycle after providing it.


1 Answers

you can view this example may this will help you

Android Camera2Basic Sample

This sample demonstrates the basic use of Camera2 API. Check the source code to see how you can display camera preview and take pictures. Pre-requisites

Android SDK v21 Android Build Tools v21.1.1 Android Support Repository

https://github.com/googlesamples/android-Camera2Basic

like image 148
A-Droid Tech Avatar answered Oct 02 '22 13:10

A-Droid Tech