Tuesday, March 27, 2012

Re: [android-developers] How to load web page in background

Thanks Lucas,

Have a small question on the following,

                   entity.consumeContent();
                    if (entity != null) {
                        entity.consumeContent();
                    }

after consuming, why should we again check for null and consume again ?

Can we use  SerializableEntity instead of HttpEntity?

Please share, If you have any link to sample android program.

Thanks
Rk


On 27 March 2012 19:33, Lucas Diego <diegolucasb@gmail.com> wrote:
I think u could use HttpClient from http://hc.apache.org/httpclient-3.x/
if you try something like this, it might be useful:

                    HttpGet httpget = new HttpGet(http://www.your_url.com);
                   
                    HttpResponse response = httpClient.execute(httpget);
                    HttpEntity entity = response.getEntity();
           
                    entity.consumeContent();
                    if (entity != null) {
                        entity.consumeContent();
                    }



I hope it helps you!


On Tue, Mar 27, 2012 at 10:54 AM, rk <ramakrishnarao5@gmail.com> wrote:
How to load web page in background ?

As part of my application, Im supposed to present a web-page to the
user.

The webpage is about >.5M (has lot of images and js), so i cant fire
an activity, as user has to see the page loading for considerable
amount of time, if user is on slow network connection.

Is there any way that I can load it in background and show the
activity, when the loading is complete?

Thanks

--
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
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
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
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
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
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment