Saturday, January 2, 2010

[android-developers] Re: Best HTTP Request Method

Thanks!

After doing a TraceView, I found that most of the processing time is
spent in the EntityUtils.toString(entity); portion...any ideas how to
speed it up/circumvent this step?

On Jan 2, 12:47 am, Brion Emde <brione2...@gmail.com> wrote:
> I think that it is automatic. Just be sure to keep your HttpClient
> object around for as long as you're going to be using it. For example:
> create the HttpClient in your onCreate() and close it in onDestroy()
> for your activity.
>
> On Jan 1, 10:45 pm, SizzlingSkizzorsProgrammer <cbo...@gmail.com>
> wrote:
>
>
>
> > Thanks a lot!  Just wondering:  how do you set the keep-alive
> > setting?  I just can't seem to get it!
>
> > Thanks for all your help!
>
> > On Jan 1, 5:08 pm, Frank Weiss <fewe...@gmail.com> wrote:
>
> > > I've seen 5 sec occasionally getting an rss feed of about 28 KB using
> > > java.net.URL.openConnection().getInputStream() and then parsing it with
> > > SAXParser. It looks like you're doing a POST to send form data(?) so you may
> > > have to stick with HTTPClient.
>
> > > If you're doing frequent requests, you can probably take advantage of
> > > HTTPClient's "keep-alive" connection management.
>
> > > If you're looking for optimizations, I strongly suggest you create a test
> > > app which performs the samerequestyou're having performance problems with.
> > > Collect more data, such as the size of therequestand response. Try the
> > > samerequestfrom a different platform (like your laptop or desktop).
> > > Compare the network paths between the desktop and Android to the server.
>
> > > I know you'd like to just get an answer "do this/try this". I hope that by
> > > looking into the problem in more detail you''ll find a solution.
>
> > > On Fri, Jan 1, 2010 at 3:36 PM, SizzlingSkizzorsProgrammer <cbo...@gmail.com
>
> > > > wrote:
> > > > About 5 seconds, which isn't unbearable, but considering my app needs
> > > > frequent requests some kind of optimization must be possible.
>
> > > > Look at the android market...it seems to load everything pretty fast
> > > > (much faster than my app at least!)
>
> > > > On Jan 1, 3:15 pm, Frank Weiss <fewe...@gmail.com> wrote:
> > > > > Considering that the execute method's latency includes network and server
> > > > > times, on what basis do you think it's taking too long? What latency are
> > > > you
> > > > > observing, less than one second, more than one minute?
>
> > > > > On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer <
> > > > cbo...@gmail.com
>
> > > > > > wrote:
> > > > > > Yes, I've tried logging and theHTTPexecute definitely takes the
> > > > > > largest chunk of time, but how can I speed it up?  Is there another
> > > > > > protocol/method?
>
> > > > > > On Dec 31 2009, 6:07 pm, jotobjects <jotobje...@gmail.com> wrote:
> > > > > > > On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer <cbo...@gmail.com>
> > > > > > > wrote:
>
> > > > > > > > It works fine, but it's quite slow...any way to make it faster?
>
> > > > > > > A guess would be that theHTTPnetwork speed is 100's of times slower
> > > > > > > than all the rest of the code. You might log the time before and
> > > > after
> > > > > > > the execute method if you haven't already done that.
>
> > > > > > --
> > > > > > 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<android-developers%2Bunsubs cribe@googlegroups.com><android-developers%2Bunsubs
> > > > cribe@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<android-developers%2Bunsubs cribe@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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate