i want to capture the image from camera and upload on server
for capturing image which is best direct using intent simple sort code or using view or surfaceview which is best
when you use the basic Intent
, you don't really need to bother with sufaceView or View. the user is prompt with the image and is asked if to save it or not. using the onActivityResult
will take care of the upload.
have you looked at the android camera image capture? they have sample code for all the possibilities of capturing images from the android camera.
If you want some customization in your activity or some other functionality with image capturing then surfaceview is best. One example i have already given you can try this to capture frames. I have explained everything if you are having any problem then you can ask I will try to help you. Instead of onPreviewFrame use on picture taken.
hope it will help you.