On Thu, Mar 17, 2011 at 11:11 PM, hardrock <hardrock...@gmail.com> wrote:
> 1. AppWidget extends BroadcastReceiver.
>   This meams that even *ANY* appwidget cannot guarantee from system-
> kill.

Correct.

>   Isn't there any way to prevent time-freezing of digital clock
> widget ?

Don't write a digital clock app widget.

Or, if you are willing to settle for a digital clock app widget that
only updates once per minute, use AlarmManager.

> 2. I think that it's better to use AlarmManager than
> ACTION_TIME_TICK(because receiver die) every minute.
>   But there is some problem.
>   If the system kill my clock widget during working AlarmManager
> every minute,

The only reason the "system kill [your] clock widget" is if you have a bug.

>   Isn't there any way to cancel alarm when system kill my clock
> widget.

No, but you can reboot your phone (thereby clearing all scheduled
AlarmManager alarms), then fix your bug.

> 3. For battery consumption,
>   which is better between using AlarmManager and using
> ACTION_TIME_TICK every minute.

AlarmManager. You cannot have a BroadcastReceiver in the manifest for
ACTION_TIME_TICK. Hence, to monitor ACTION_TIME_TICK, you would have
to have a service running constantly, which is a very bad design
decision, in part because it doesn't work.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

-- 
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