I am using given link https://github.com/googlesamples/android-Camera2Basic to make a new Camera2 for android version 5.0. Camera is working fine for me but sometimes preview does not set properly. I am sharing the images of camera preview below.
And second images is
please help me to short out the issue.
Note* How i can implement the Front and back camera open feature.
Thanks
Related
I'm planning to make a camera app that you can take a photo with a background image.
I guess there will be a need to use a Surfaceview? But the main problem is since the Camera is deprecated
there might be a need to use camera2 for android. I want to make a camera app in portrait mode but are there any
samples or tip? I googled but wasn't able to find a decent one. I would love to hear from you.
If you want to start with Camera2 API, this link will help you understand basics.
android-Camera2Basic(Github)
It is not necessary to use SurfaceView as you will see from code
that TextureView can also fulfill your requirement
The HdrViewfinder sample app uses SurfaceView with camera2, though it doesn't lock itself into portrait mode. But that's a relatively simple change.
Of course, camera2 was only added in Android 5.0, so if you need to support 4.0, you need to use the old camera API.
Is there any way to have a camera preview using the camera2 library while running the application? I only need one method which is able to show in the app the camera preview (not taking pictures or opening the camera APP).
Take a look at CameraView, an unofficial support library widget for drawing camera preview easily (It can also take snapshots, but you can ignore that part).
I am using google's library cameraview to integrate the camera API for different version.
This issue is coming on API 25 only.
When I restart the camera after capturing image. It remains black on the screen. I could not find any solution regarding NOUGAT api lib. How can I solve the camera preview generation again. please let me know if there is any solution for the particular naugat version. First image is when I start my activity. It will capture the image but after capturing my image I restart the camera view it will remains black. Other lower then Android 6.0 it is working fine.
I've looked for tutorials on how to do this but everything I've found uses the deprecated Camera class. Can anybody point me to good resources on how I can show a live camera preview in my app? Or possibly show me some example code with the bare minimum needed to pull up a live preview of the camera?
There really seems to be no information on how to acess the front facing camera on android phones (gingerbread).
Could someone please point me to a page or post that explains how it's done?
Thanks!
Here is an example on how to access different cameras and switch between them: CameraPreview
The link is not accessible right now, Google has moved the Sample Project.
Please import a Sample Project and find it at:
ApiDemos/com.example.android.apis.graphics/CameraPreview.java
Mat be this might help you How to use Front Facing Camera on Samsung Galaxy S
As for 2.3 Camera you can try this method passing the camera ID