开发者

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 sa开发者_StackOverflow中文版me 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜