I appear to have found the problem. The polling thread was starting in the constructor of a different class, and NOT from the UI thread. I changed the code to launch the polling thread from the main UI thread in the call to the Activity's onResume method - and it seems to be working quite well on the handset now.
Why would this make a difference? No idea. I am assuming it's some subtlety of the security implementation with respect to threading. Perhaps the reason it worked on the emulator is that my handset and the emulator are at different release levels. On Nov 25, 8:12 am, JP <[EMAIL PROTECTED]> wrote: > Not putting words in Mark's mouth but he meant to explain that you > need to eliminate uncertainties; one being the site you try to access > and if it's bomb proof as you describe; done. > > Next - you've got to isolate the problem. No way around it even though > recreating the problem in a sandbox will cost you a couple of hours. > Wireless comms is a tricky environment; the spiel of the different > states of the underlying stack and their impact on your app are more > complex than what you will find in the emulator. For test purposes, > you definitely should reduce the complexity of your multi-threaded > environment. The correct approach for the architecture of your app > (perhaps more complicated than need be?), but a candidate to cause > trouble if you do not fully understand the dynamics of the underlying > communications stack (emulator vs. the real thing). > > On Nov 25, 5:43 am, joshv <[EMAIL PROTECTED]> wrote: > > > I can disclose the URL, it's publicly available and always up - yahoo > > finance csv stock price download. For > > example:http://finance.yahoo.com/d/quotes.csv?s=GOOG+T&f=sl1c1p2 > > > It doesn't get much more highly available than this. I could test > > other URLs, but as I have mentionned before, the exact same code, with > > the exact same URL runs marvelously in the emulator, so I very much > > doubt it has anything to do with the URL. It's also not specific to > > wi-fi on the handset. I get the same behavior when I disable wi-fi > > and use only 3G. > > > It would take me a bit of work to create a reproducible snippet, no > > proprietary concerns - just space. The code snippet I've already > > posted is simply running in another thread spawned by the UI thread. > > If I get some time I will try to work on a self-contained demo that > > reproduces the problem on my handset. > > > On Nov 25, 7:02 am, Mark Murphy <[EMAIL PROTECTED]> wrote: > > > > joshvwrote: > > > > I am really starting to think that there is something wrong with my > > > > handset. I certainly have no problem with transient disconnects and > > > > such resulting from moving from cell to cell, or from 3G to wifi, or > > > > edge to 3G - but I am sitting 3 feet from a very stable access point. > > > > Here's my recommendation on how to proceed: > > > > First, create a separate really simple application that uses your > > > current techniques (URLConnection or HTTPComponents) to access a Web > > > site. Retrieve a Web page that is a no-brainer > > > always-gonna-work-for-everyone page, particularly one that is OK for you > > > to disclose. > > > > If this gives you the same symptoms as you're experiencing in your main > > > application, post the manifest, layout, and activity source code, so > > > some of us can try it and see if we get problems on our devices. > > > > If, however, this simplified example works just fine, start to slowly > > > convert it to look more like what's giving you problems (e.g., switch to > > > the actual Web page you're trying to hit instead), and see where the > > > problems creep in. > > > > At the point when you start getting problems again, if your test code is > > > still safe for public release (e.g., no proprietary information), post > > > the manifest, layout, and activity source code, so some of us can try it > > > out and see if we get the same problems. > > > > Going all the way back to your original post, the snippet of source you > > > provided doesn't seem problematic (other than I'm a fan of > > > HTTPComponents over URLConnection), but, then again, we aren't going to > > > be able to reproduce your problem with just that snippet. > > > > In the end, if we collectively get a reproducible scenario that works, > > > that sample code should serve us well on the issue tracker to make sure > > > this gets looked at. > > > > -- > > > Mark Murphy (a Commons Guy)http://commonsware.com > > > > Android Training on the Ranch! -- Mar 16-20, > > > 2009http://www.bignerdranch.com/schedule.shtml --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---