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!
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