I have read the material regarding UILocalNotification , but there is no way i find to play a infinite loop sound when the notification is fired , it does play for a short time with showing an alert, but i want to achieve the goal of playing a continuos sound by providing the option of snooze and quite . I have gone through the UIEvent Kit too but unable to find a way to achieve this goal. One more question is there a way to customize the alert button action which are provided by default by the apple.
looking for you guys early response
Thanks in Advance.
I did not do that but there is a function when local notification fires this function is invoked but before it invoked the ok or view or what ever you name the button should be pressed after that you can sms code in that function and it should take care for that ...Hope This will help you
Related
I'd like to implement an alarm clock/reminder function in a Lwuit application, where the user may set an alarm time, and at that time a reminder dialog pops up with an alarm sound. However, I'm unsure about the approach. So help on any of the below questions would be greatly appreciated:
How to keep a timer running constantly, no matter what Form is displayed, e.g. without interfering with lwuit and EDT?
What's the right way to implement the trigger mechanism that will make the reminder Dialog box pop up? This may happen at any time, no matter what Form is currently displayed and shouldn't interfere with the ongoing user operation, so that when the reminder dialog is closed the user can continue whereever he was when the reminder popped up.
And finally, when the application is closed, or not running in the foreground, how can I keep a timer running? With the new and exiting CodenameOne coming up, I'd obviously like the solution to work on both J2ME, iOS and Android.
Sorry, if the answers are obvious, but I haven't been able to find a solid working solution.
1) You can use java.util.Timer for a generic timer, its callbacks will occur off the EDT so in order to use LWUIT you would just need to callback into the EDT using Display.getInstance().callSerially() and have your code within the Runnable callback.
2) In order to not block input and display in an unobtrusive way you can use the glasspane to just show a translucent element on top of the screen. It will not block input in any way. There is a sample of that in the LWUIT Chat demo application.
3) You can't. Background process execution isn't really supported on any device, all devices have a special "use case based" solution for background execution which requires you to write your applications in a very specific way. Codename One will add support for push notification which will allow you to push an alarm from your server. Seams counter intuitive at first but if you consider the amount of battery life that will be taken up by background processes it becomes pretty obvious why this was done.
I have a volume slider in my application that I'd like to have a sound effect play when the user changes the value. The standard valueChanged event works well here, and I'd like to use it in conjunction with a touches ended signal to trigger the sound at the end. Is there a control event here that I'm missing that would run my method when the touches finish? It doesn't seem like there is a UIControlEventTouchesEnded...
Some code samples would help, but I guess you're looking for UIControlEventTouchUpInside. I'm not sure, if it works with a slider.
One possibility would be to set the slider's continuous to NO. Now it emits just one valueChanged event, namely when the user is all finished - just what you want to know.
I am developing a simple quiz game in which if a button is clicked then the player can have two chances to give answer. If first choice is right, then buttonClicked action will performed. If it is wrong then player can have second chance to give the answer. if it is correct, buttonClicked will performed otherwise game over.
please guide me how to perform this .. Any help will be highly appreciated..
UIControll has property enabled.
If the enabled state is NO, the control ignores touch events ...
I face a very weird experience, when i receive multiple notification and then didn't response to it immediately. After a while, i pressed the view button and it open my application and show black screen.
BTW, the application is running at background when i click the view button and it also doesn't trigger didReceiveLocalNotification.
Does anyone know what is the problem?
Thanks
When your application is running in background and if notification come, then it will call applicationFinishLauchingwithOptions Method. So write your logic in that part.
I want to fire an alarm that will ring after 2 secs. How to handle alarm code.
Any help?
Thanks
You should look into the NSTimer class
It really depends what do you mean by an alarm...
If you want a popup alert after a while, you can use Local Notification, which is an iOS 4 feature. An example can be found here.
If you need certain function to be invoked by a timer, try NSTimer. Here is an example.