I have been reading much from various sources on ways to update a widget that is using ImageView Canvas and Draw method to display a clock with a seconds hand.
It must be updated every second. What is the most efficient way to do this? Use a Service
, the Alarm Manager, Handlers?
It can be done, e.g., the Android app "Arc Clock Widget".
Anyone with any ideas?
Thanks,
Tom
There are several solutions discussed on this page :) A Tutorial on Making an Analog Clock Widget for Android
I have used the AlarmManager to do this myself and I did not notice any significant battery drain as the AlarmManager does not wake the phone to update the widget when the phone is asleep. Anyways, no one will be seeing the widget when the phone is asleep. Also, see this note on this section of the Android Developer Guide. Using AlarmManager to update frequently