Just to post an update on this issue, the alarm manager approach seems
to work. To simulate a TIME_TICK, I'm using the following code:
// First alarm to go off when the RTC minute changes
long firstTime = System.currentTimeMillis();
firstTime += (60000 - firstTime % 60000);
// Schedule the alarm
AlarmManager am = (AlarmManager)context.getSystemService
(Context.ALARM_SERVICE);
am.setRepeating(AlarmManager.RTC, firstTime, 60000, sender);
where "sender" is a PendingIntent I declared earlier.
The CPU/battery usage doesn't seem too heinous at this point, and I
have some further tuning to do. So I'm keeping my fingers crossed.
If I do have to try to make AnalogClock work instead, though... I know
that it's possible to use custom dial and hand drawables, but can't
see how to make that happen in an AppWidget (using RemoteView). Can
anyone shed any light on that?
Thanks much,
String
On Jul 6, 7:23 pm, String <[email protected]> wrote:
> On Jul 6, 5:59 pm, Dianne Hackborn <[email protected]> wrote:
>
> > You can use the AlarmManager.
>
> Thanks, I'll see if I can make that work.
>
> > Be very careful, though, you can easily make
> > your widget a big battery hog.
>
> I'm well aware of that danger. :^) It might sink the whole project,
> but there's no way to know until I try!
>
> String
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---