Search code examples
androidandroid-cameracrop

Android : Take a photo from with in my layout without starting a camera intent


I want to take a photo from my camera, however I don't want to start a new intent to capture a photo but I want the camera to open inside my layout and then click a button to take the photo, like in the bellow picture.

enter image description here

So is it possible to do it because i didn't find any ressources about this, also I prefer that the token photo to be cropped?


Solution

  • Google demo of Camera2 Api. It will help you. Link : https://github.com/googlesamples/android-Camera2Basic