Dude - there is a ton of code on the net and in this forum that answer
this question. I know it's easy to post a question and wait for people
to solve the problem for you but common...

I'll let you go with a warning this time - here is the code

String strURL = "http://www.mylittlesite.com/android.xml";;
HttpClient client = new DefaultHttpClient();
HttpGet getMethod = new HttpGet(strURL);
try {
    HttpResponse response = client.execute(getMethod);
    String data = EntityUtils.toString(response.getEntity());
...

You might want to play with setHeader method of the getMethod because
I found that many web server don't like requests coming from weird
browsers like Andriod's

Here is how to fake Firefox on Windows
getMethod.setHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4");

On Dec 9, 4:28 am, SinFrancis <[EMAIL PROTECTED]> wrote:
> how can i download the file from web??
>
>  httpClinet ?
>
> please tell me the API  or give me some demo!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to