On Thu, Dec 4, 2008 at 6:26 PM, Dianne Hackborn <[EMAIL PROTECTED]> wrote: > You can look in I believe /data/anr/traces.txt to find a dump of the stacks > of all processes and threads when the ANR happened, which should tell you > what your thread was stuck doing at the time.
Ah, nice. You should put this in your documentation on ANR on your web pages. Stupid question: how can I read this from the shell on my G1? It's giving me file perm error on /data (which isn't true of the emulator). So I finally figured out what was going on. It had nothing to do with HTTP posts, thankfully. What it did have to do with was Formatter (or String.format). An innocuous foreground loop using Formatter was taking 10 seconds for about 10kb worth of data. The same loop using string concats (ie, this+""+that) takes 100ms. What on earth is Formatter doing that takes 2 orders of magnitude more time? Something's really out of whack. Interesting tidbit2: per Mark's suggestion, I implemented the HTTP post using both HttpURLConnection and DefaultHttpClient mechanisms. The DefaultHttpClient method was about 5-10x *slower* than HttpURLConnection for identical data. Not sure why that is... maybe using stringsBuffers to collect the post data instead of file io is a lose. Mike > > On Thu, Dec 4, 2008 at 4:27 PM, <[EMAIL PROTECTED]> wrote: >> >> Yes, I've already coded that up and it behaves identical to >> HttpURLConnection. So that's >> not the root cause of this. >> >> I just tested this on 3g vs. my home wireless and it too behaves >> identically, so it's not the >> kind of net connectivity that's causing this either. >> >> Mike >> >> On Thu, Dec 4, 2008 at 4:21 PM, Mark Murphy <[EMAIL PROTECTED]> >> wrote: >> > >> > [EMAIL PROTECTED] wrote: >> >> So I switch over to using DefaultHttpClient and friends and it... >> >> behaves the same way. >> >> (I assume that's what you meant by HTTPComponents aka the apache >> >> stuff?) >> > >> > Yes, the stuff in org.apache.http.*. Documentation can be found at >> > http://hc.apache.org, and example code for HttpClient can be found at: >> > >> > http://hc.apache.org/httpcomponents-client/examples.html >> > >> > -- >> > Mark Murphy (a Commons Guy) >> > http://commonsware.com >> > _The Busy Coder's Guide to Android Development_ Version 1.9 Published! >> > >> > > >> > >> >> > > > > -- > Dianne Hackborn > Android framework engineer > [EMAIL PROTECTED] > > Note: please don't send private questions to me, as I don't have time to > provide private support. All such questions should be posted on public > forums, where I and others can see and answer them. > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---