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. <WTA> Signal im3....

radionya untuk yg dream dah yg latest itu, amonra recovery ga ada ngaruh ke
signal...

coba lock ke 2g only gmana kualitas signalnya...

sent from Milestonewith  | read www.tux.or.id & http://bit.ly/aSTXL0 for
more android info




senior2 mw tny donk ko akhir2 ini sinyal im3 saya di dream melemah bahkan ga
ada sm sekali pdhal punya tmn saya ditempat yg sm sinyalnya penuh
apakah pengaruh klo ga pernah update baseband radio sama amon ra nya
yg saya updet terus cm rom cyannya sdngakan amon ra sm radio msi pke yg lama

status phone:
firmware version 1.6
baseband radio 62.50S.20.17U_2.22.19.26I
kernel version 2.6.29.6-cm42sh...@toxygene
mod version cyanogen mod-4.2.14.1
build number DRC83

mhon pencerahannya mangstah...

-- 
"Indonesian Android Community [id-android]"

2. Operator 3 mulai....

Waduh.......belum sebulan dah mulai....terutama di rumah (Green Ville)

Semalem berasa lambat banget.......padahal sinyal 3G (oya logo-nya gak bisa H ya ? Spica langsung H lho dgn 3 :D ) Pas iseng test pake speedtest cuma dapet................................. 0,01mbps dooh!!! ---> pas ada dua Dream dan sama make 3 juga....test....sama aja..... TFlash Unlimited tutup gak yah ? -- Jus* ~ send using pc jangkrik krik krik ~ -- "Indonesian Android Community [id-android]"

3. TableLayout with fixed row & column

4. Market Intent Suggestion

5. android console shell

6. Update3: Kloteran External Battery 4400mAh - Just Mobile Gum Pro & Gum Plu

7. Horizontal Mode for Messaging