No Network Connectivity in Service/AlarmManager Process.

by Mark Murphy » Thu, 25 Mar 2010 07:52:18 GMT


Sponsored Links
 


That looks strange.

-- WifiLock is managed by WifiManager, which is not a PowerManager.

-- WifiManager has a createWifiLock() method to create the WifiLock, not
a newWakeLock() method

Also, I'm not sure this is necessarily going to work if you are locking
and unlocking at the time you are doing the WakeLocks. If your goal is
for WiFi to be available immediately upon the alarm, you will need to
use a WifiLock to keep WiFi active back when you schedule the alarm. To
quote from the WifiLock documentation:

"Normally the Wi-Fi radio may turn off when the user has not used the
device in a while. Acquiring a WifiLock will keep the radio on until the
lock is released. Multiple applications may hold WifiLocks, and the
radio will only be allowed to turn off when no WifiLocks are held in any
application."

If this is something that's supposed to be going on 24x7, since keeping
the WiFi radio on all that time will drain the battery pretty good, I
think you're more going to need to just hang tight in your
doWakefulWork() until WiFi connectivity is restored.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android Training in NYC: 10-11 April 2010:  http://guruloft.com 

--



No Network Connectivity in Service/AlarmManager Process.

by Mark Murphy » Thu, 25 Mar 2010 08:33:31 GMT


 


Then grab a stronger WakeLock, I guess.


Actually, it pretty much works as the name suggests.


Probably there is, but perhaps a partial WakeLock is insufficient.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android Training in US: 14-18 June 2010:  http://bignerdranch.com 

--


Sponsored Links


No Network Connectivity in Service/AlarmManager Process.

by Mark Murphy » Sat, 27 Mar 2010 21:31:44 GMT


 


Like I said, I am not aware of any such limitation. As I wrote, the only
times I know of when alarms get nuked are:

-- on a reboot, all alarms go "poof!"

-- if the user has a so-called "task killer" app and kills your app that
way, your alarms go "poof!" (though alarms from other un-killed apps
remain in place)

Conversely, there are places in Android itself where AlarmManager is
used from an Activity -- alarm clock and calendar, to name two.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_The Busy Coder's Guide to Android Development_ Version 3.0
Available!

--



Other Threads

1. Has anyone built IM.apk and ImProvider.apk?

Has anyone built IM.apk and ImProvider.apk?  If so, can you please
post those .apk files?  They are not shipped with the 1.0 SDK and I
don't have a mac or linux machine that I can use to build them myself
now that the source code has been released.

Thanks!!!
Cheryl
--~--~---------~--~----~------------~-------~--~----~

2. How to put a Label value in Spinner e.g <Choose>

How to put a default value in Spinner ,the value which is not coming
from DB.. Some thing like

<Choose Contact>
or
<Select>

On the Spinner it should show something like this,and then when user
selects it,then he/she actually can get the value from DB or whatever
set.
--~--~---------~--~----~------------~-------~--~----~

3. Accessing the Task Manager

4. Problem with Handler and messages

5. Linux help command?

6. If delete R.java, how how can recover it?

7. ListView Choices: What the devil is happening?