The wi-fi lock sounds interesting, but I'd need it to work with the cellular network as well. Can I lock both? Actually, a lot of my testing is probably happening over wi-fi since for some reason my Dev 1 Phone doesn't like my AT&T iPhone SIM card for data connections. Perhaps it really does work with cellular networks.
Within the doWakefulWork function I instantiate a class and call one of its methods. It ultimately creates a new Thread to make the Socket connection. I guess that's the issue. Instead of releasing the lock at the end of WakefulIntentService.onHandleIntent, could I pass the lock into my Thread and release it from there? Your KungFu is the best! On Mar 24, 5:21 pm, Mark Murphy <[email protected]> wrote: > AuxOne wrote: > > I have a Service/AlarmManager set to go off ever hour; as seen at: > >http://github.com/commonsguy/cw-advandroid/tree/master/SystemServices... > > That link looks strangely familiar... > > > The Alarm triggers a Socket connection to communicate with a Web > > Server. > > The code you link to above uses an IntentService, so the service will > shut down as soon as the work is done. Are you doing all your HTTP stuff > within the IntentService's handler? > > > I'm logging the interaction to a file so I can see it later. > > When I leave the phone on my desk for a day, it seems that more often > > than not I get a "Network unreachable" error when trying to do any > > networking. > > > I believe it is related to how deeply the phone goes into sleep. Is > > there a special kind of lock I have to hold, or some command required > > to prep the wireless radio so that it can be ready to access the > > Internet? > > You can hold a WifiLock. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android 2.x Programming Books:http://commonsware.com/books -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

