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.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. Trying to compile Android on to a Full blown ubuntu/linux distro

On Linux, it is possible to build the Android simulator, which runs many
parts of the platform in a single Unix process (so no real security for
you), doesn't use the custom C library, etc...

if you don't want to go this route, you will need to patch your kernel to
integrate a few Android-specific things like the Binder driver.
second, Android expects system files in different places, comes with its own
init program and scripts, etc...

running the whole of Android on top of a standard Linux installation will be
a lot of work with probably few benefits. You should probably try to get the
Dalvik VM running first on Ubuntu plus some of the system libraries that
don't depend too much on Android-specific behaviour.


2. RIL data service flow path

Dear all,
Is there any one has experience the data service path of RIL?
I mean, in the Android reference RIL, the AT command will go though RIL and
TTYS0 to connected MODEM, if I want to setup a data call, what is the
routine of data flow from application to RIL to MODEM (on the assumption
that data and AT use same TTYS0)?
Thanks for your help.


3. Can't seem to get something as simple as a ListView to work

4. email client of emulator ( second sdk release) not working

5. JNI - FindClass() returns null

6. UI question: onTouchEvent and ListActivity

7. ArrayAdapter / spinner help