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. Scrolling speed in Gallery widget

Hi all,

I've noticed the scrolling "speed" in the Gallery widget is rather
fast.  This is probably the first time I'd say something is rendering
TOO fast.

Here's the example:

Imagine 5 icons in a Gallery widget scrolling horizontally, each icon
takes up 1 screen width.  If you swipe your finger to move the current
image, the rest of the gallery's icons fly by very fast (instead of
just moving you to the next icon).  You must move your finger pretty
slow to accurately move through one-by-one.

Is there a value which one can change the "coefficient of friction"
for scroll speed in Gallery?  So one can make it "drag" a little
slower instead of flying by so quickly.


Thanks,
AJ

--~--~---------~--~----~------------~-------~--~----~

2. HTC Magic for development using the android source code

I tried to use HTC magic for development.
But It is not booting up.

Can you please help me up?

I followed the steps as
http://developer.android.com/guide/developing/device.html

And used latest master branch code system image. Please help me.

--~--~---------~--~----~------------~-------~--~----~

3. Grid of clickable views

4. start

5. Is there any way to get galk friend list at android?

6. wide character problem

7. Creating a rom image