On Tue, Jun 14, 2011 at 1:17 AM, Simon Platten
<[email protected]> wrote:
> Ok, so how do  you schedule an alarm in the same way the alarm clock does?
> So that once scheduled the application can be killed, but the alarm remains
> ?

You can't. The alarm clock itself can have its alarms removed, AFAIK.

> On ny phone I regularly kill all processes using task manager, yet my alarn
> continues to wake me up everyday.

First, you are not killing "all processes", otherwise the phone would
crash. This may be news to you, but computer operating systems use
processes to actually run.

Second, most likely, the alarm clock process was not running at the
time you killed "all processes".

The act of task-killing (task killers) or force-stopping (Settings
app) is associated with a process. A side effect of task-killing and
force-stopping a process is that all scheduled alarms are removed that
were associated with the application that was running in that process.

As I wrote before:

>  The alarm clock app's code is only running around the time the user is 
> setting an alarm or when an alarm is occurring.

Hence, unless you actually task-kill/force-stop THE ALARM CLOCK'S
PROCESS, the alarm clock's ALARMS WILL REMAIN UNAFFECTED by any other
task-killage/force-stoppage that goes on around it.

A well-written application using AlarmManager will behave much like
the alarm clock app: the app is only active while delivering actual
value to the user. For example, IntentService is frequently used with
AlarmManager to make sure the service goes away ASAP once its value is
delivered.

Task killers have one difference compared to the Settings app -- they
tend to *really* focus on processes, whereas the Settings app focuses
more on components (i.e., "Running Services"). A process does not
immediately exit once all activities are finished and services are
stopped -- Android hangs onto the process until it needs the RAM, in
case for some reason that same application needs to run again. Hence,
a task killer is more likely to attack processes that are actually
well-behaved, and there's not much you can really do about it.

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

Android Training in NYC: http://marakana.com/training/android/

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

Reply via email to