Downloading a file after http-get and http-post.

by Robin van Leeuwen » Sun, 18 Jul 2010 20:24:43 GMT


Sponsored Links
 Hi there,

i am building an application which at some point sends a http-get to a
webserver and the webserver responds with a .zip file to download.
The same with a http-post. In a browser after clicking submit (post) or the
link (get)
it asks me where i should download the .zip file.

I want my android app to automatically download the file:
In the case of the post i build a name-value-pair and use execute the built
httppost:

 httppost.setEntity(new UrlEncodedFormEntity(nvp));
 HttpResponse httpresponse = httpclient.execute(httppost);
 HttpEntity entity = httpresponse.getEntity();

How can i download the .zip file with which the webserver responds.

Can someone point me in the right direction, or perhaps give me an example
how to download files in android?

Kind regards,

Robin van Leeuwen

--



Other Threads

1. Getting the PERSON_ID based on CallLog.Calls data

Please help cause I'm pulling my hair out over here. How can lookup
the Person based on the info in CallLog.Calls? I've tried matching
Phones.NUMBER to Calls.NUMBER, I've played a little bit with
Phones.NUMBER_KEY (what is the normalized format btw?) and I even
tried doing a LIKE search while replacing any non-numeric character
with a %. I've had no luck actually looking up people based on CallLog
info.
--~--~---------~--~----~------------~-------~--~----~

2. everyone likes compliments :*)

Step 7 of exercise 3 in the Notepad Tutorial at

   http://developer.android.com/guide/tutorials/notepad/notepad-ex3.html

mentions that "onPause() and onResume() are also complimentary
methods."  Sadly, when they ran, I didn't receive any.

- Greg
--~--~---------~--~----~------------~-------~--~----~

3. Enabling/Handling cookies on the Webview

4. how to add a progressbar or other widget to some row of the listview??

5. Audio/Video User Interface

6. Neighbor CID

7. call for android developers, high profile comission