How to upload a camera image in an Android app

in my application, I placed the "Add photo" button, when the user clicks the button, a pop-up menu appears with 2 additional cameras and a library. When I select a library, I can go to the device’s photo album. Below is the code I use to go to the mobile library

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

any image that I click there, I want it to be uploaded to the url,

in the same way that the image I am shooting through the camera also wants to be uploaded to the URL.

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

+7
source share
1 answer

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

How to select an image from the gallery (SD card) for my application?

Then find an example of downloading a file using http, any Java example should work, for example:

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

+5
source

All Articles