Search code examples
androidandroid-camerasurfaceviewcamera2

Android SurfaceView or Camera2 API for camera preview


I am trying to implement the camera preview function into my app. After a lot of research I found that the best solution is the Camera2 API, but, it isn't supported on most phones. Is there a better solution to do this? For example, I read a lot about using a SurfaceView to load the camera preview on.


Solution

  • I simply followed the Android docs to use the camera API. Camera2 API is fairly new and I want to make sure all users can have it.