[android-developers] Re: How did they made those "solve the math to dismiss the Alarm Clock" type apps?

2009-07-30 Thread Mark Murphy

alucard20004 wrote:
> 1. User can just turn off the phone. How did the developer prevent
> user from turning-off the device?

They probably do not stop the user from turning off the device (i.e.,
holding down the end-call button and choosing Power Off). I would be
rather disturbed if an application could do that.

They might stop the user from putting the phone to sleep (i.e., pressing
the end-call button) by holding a suitable WakeLock.

> 2. If the user CAN turn off the device, how did the developer schedule
> the 'math' activity to start next time the device is turned on?

Possibly by arranging to have a BroadcastReceiver respond to the
ACTION_BOOT_COMPLETED broadcast Intent.

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

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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



[android-developers] Re: How did they made those "solve the math to dismiss the Alarm Clock" type apps?

2009-07-30 Thread Dianne Hackborn
I certainly hope they don't hold a wake lock. :)  They should just schedule
an alarm.

On Thu, Jul 30, 2009 at 4:27 AM, Mark Murphy wrote:

>
> alucard20004 wrote:
> > 1. User can just turn off the phone. How did the developer prevent
> > user from turning-off the device?
>
> They probably do not stop the user from turning off the device (i.e.,
> holding down the end-call button and choosing Power Off). I would be
> rather disturbed if an application could do that.
>
> They might stop the user from putting the phone to sleep (i.e., pressing
> the end-call button) by holding a suitable WakeLock.
>
> > 2. If the user CAN turn off the device, how did the developer schedule
> > the 'math' activity to start next time the device is turned on?
>
> Possibly by arranging to have a BroadcastReceiver respond to the
> ACTION_BOOT_COMPLETED broadcast Intent.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> Need Android talent? Ask on HADO! http://wiki.andmob.org/hado
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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