android - How can I make an app trigger a set of actions on April 01, 2011? -


I am trying to make an app on my wife's phone which she wishes for April 01, April Full Day Course gives. The app is changing its background to look like a screen, in the background when I try my disorder, I am very strong. (I was equally naughty).

Anyway, how it will work, I think it's a lot of process, though, I can see it in a very far away. I started diving to set up an alarm, however, I am confused about some things:

  1. Is this my son's phone call for this mischief application in the background? Would it be necessary to load the bar to reboot it? I am assuming yes, as I believe this prank application will most likely have to invite a broadcast receiver for "listening" for April 1, 2011?

  2. If applications are not required each time they load in the background, which is alerting my application to Android and when it fires on April 1, 2011, So what's the facility?

I hope that in any sense, basically, I want to ensure that this app runs on 1st April 2011, even if my wife's phone Crash or reboot.

What would be the most direct way to do this work? If I do not understand broadcast receivers properly, then I apologize, this is a new concept that I am not using.

The bill is too early to plan for April Fools, is not it? ? :)

All you need is the same BroadcastReciever .

Add a BroadcastReciever to BOOT_COMPLETED you are going to be onRecieve () to filter your intentions. It will be in 2 cases

1) Your phone will boot.

2) Your alarm hits.

To check , occurred, check if you have received intent action "BOOT_COMPLETED" , if so, then your phone will return on April 1 , Has set up an alarm on 2011. (Technically, you should have your custom intent action, but you do not need it in this case ...)

Now, if your work boot is not complete This means its code will change the wallpaper by using WallpaperManager in that case. Your new wallpaper will obviously be in your resources ..

  empty on references (reference CTX, intended intent) {if (intent.getAction.equals (/ * full * /) // Setup alarms using alarm manager] and {// change wallpaper.}}  

I'm sorry, if I misunderstood you, do you need help with alarm manager ?

Courses, as Macers have told you that you have SET_WALLPAPER and RECEIVE_BOOT_COMPLETED Permissions will be required.


Comments