Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

SirRevolutionary

(579 posts)
1. I'm fairly new to Android development but...
Mon Dec 19, 2011, 11:10 AM
Dec 2011

from reading the code snippet, I would think you set the destination to the server via the HttpPost httpPost = new HttpPost(url);

The method's signature would take the full URL path to post the data to: public void post(String url, ...

So that would be something like http://myserver.com/myUploadFile.php or whatever. For authenticating, I'd imagine you do that before you get anywhere near attempting to upload data. It could be done the same way as this code snippet. Have the user enter a name and password, send it to the server and authenticate before trying to upload anything.

Inside the conditional if/else statement in that code, it looks like it's going to send either an actual file (the image) or just a string to the server.

There's probably more astute Android developers on DU who could chime in and elaborate though.

Recommendations

0 members have recommended this reply (displayed in chronological order):

Latest Discussions»Retired Forums»Website, DB, & Software Developers»Android code instructions...»Reply #1