Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to upload image captured from camera in an android app

in my app i have placed a button called Add Photo, when the user clicks the button a pop up menu appears with 2 option camera and library. When i select library i am able to move to the photo album of the device. Following is the code which i am using to go to the mobile library

public void library() { Intent myIntent = new Intent(Intent.ACTION_PICK); myIntent.setType("image/*"); startActivityForResult(myIntent, 1); }

whatever image i click there i want it to be uploaded in an url,

in the same way the image which i capture through the camera also want to be uploaded in an url.

how to do this is there any API or example code pls help me

like image 382
Siva K Avatar asked Apr 07 '11 09:04

Siva K


1 Answers

This SO answer explains how to get the true path of the image in your onActivityResult

How to pick an image from gallery (SD Card) for my app?

Then look for an example on how to upload a file using http, any Java example ought to work, for instance:

http://www.jguru.com/faq/view.jsp?EID=62798

like image 160
Jim Blackler Avatar answered Sep 29 '22 12:09

Jim Blackler