that's what i did. it is set to 0. and i'm updating via alarm manager.
and i'm scheduling with setInexactRepeating(). Further looking into
the log tonight - it's is working, i had some cases with 5-10 minutes
without logging an update. Of course my update will join any other
update that wakes device up ( gmail, twitter feed etc ). Bottom line -
it's working as designed, but due to the nature of the widget it's
still be nicer to base updates on the screen state rather on device
state. I'd rather cancel all alarms if screen is off and start
scheduling new ones once it back on..
Rationale behind frequent updates - if i'm not rotating headlines in
visible fashion people complain that widget is "not working". Service
is basically just puts new headline and image on RemoteViews.

On Jul 31, 12:27 am, Jeff Sharkey <jshar...@android.com> wrote:
> When you register for AppWidget updates through the updatePeriodMillis
> parameter, the system schedules an update for you using
> setInexactRepeating() with a WAKEUP flag.  (Which forces the device
> awake for every update.)  Here's the relevant system service code:
>
> http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> The rationale behind this is that users don't want all their widgets
> to begin updating the moment they wake up a phone, slowing it down.
> Any updates should continue happening, even when the phone is asleep,
> so widgets are always ready and updated.  Several places it's been
> mentioned that you should avoid update intervals shorter than, say,
> every hour, precisely because of this fact.
>
> Keep in mind that you're completely free to set updatePeriodMillis to
> "0" (which disables updates) and manage your own update alarms without
> the WAKEUP flag.
>
> j
>
>
>
> On Mon, Jun 22, 2009 at 2:31 PM, Mark Murphy<mmur...@commonsware.com> wrote:
>
> > Alexey Volovoy wrote:
> >> Hi All , i'm looking for the best strategy for the following -- widget
> >> suppose to go through cached headlines. And once a 3 hours or so -
> >> pull new ones.
> >> Update are scheduled from widget config file. Everything seems to be
> >> working, except I don't want to running my updates which are simply
> >> changing info on the screen while phone is sleeping. What's the best
> >> strategy to avoid that ? Desired  behavior - phone is not sleeping -
> >> i'll run update which will change headline to next one and check if
> >> there is  a time to pull new headlines. If phone is sleeping - i don't
> >> want to do any of that.
>
> > AFAIK, widgets don't update while the device is asleep. Do you have
> > evidence to the contrary?
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com|http://twitter.com/commonsguy
>
> > Android Development Wiki:http://wiki.andmob.org
>
> --
> Jeff Sharkey
> jshar...@android.com
--~--~---------~--~----~------------~-------~--~----~
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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to