0

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

Sunny
  • 97
  • 2
  • 9

2 Answers2

1

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.

thepoosh
  • 12,497
  • 15
  • 73
  • 132
1

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.

Android Camera Surface View

hope it will help you.

Community
  • 1
  • 1
Bharat Sharma
  • 3,926
  • 2
  • 17
  • 29
  • i want capture the image from camera and display in imageview after give the effect on image – Sunny May 14 '12 at 06:04
  • you can see this link for example if i user surface view is create any problem for this – Sunny May 14 '12 at 06:04
  • Whatever you have shown me if that is preview not an image which you have captured then you need surface view to show buttons and all other things. But if you want to display your captured image only not preview then you can take picture by using default camera application and then set your captured image in your own activity. So it depends on your case. – Bharat Sharma May 14 '12 at 06:16