How to work with background application? - windows-phone-7

I have created an app that triggers video at particular time similar to alarm, but the problem I am facing is that when I am out of application & have set the timings the video doesn't show up(i.e. similar to alarm I should get notification out side my app). Please help me out with the same. Would be very grateful for any helpful suggestion.

When an application is not running, you cannot predict what time its background process will execute, so there is no way that you can set an alarm with any degree of precision smaller than perhaps an hour. The only way to have timing close to accurate would be with a push notification from a server. Even then, the notification you receive will not be able to open and play video on its own. You could create a push/toast notification that originates at a server, sends the user a toast, the user taps it, and that opens the app to play the video. You can't do it without user intervention.
See this link for an overview, including the constraints on background agents: http://msdn.microsoft.com/en-us/library/hh202942(v=VS.92).aspx

You cannot open an app and play a video from a background agent. You can show a toast notification that would allow the user to open the app. You can use a Scheduled Agent or PeriodicTask.You can then use the ShellToast to show a toast notification so the user can open the app. Once the app is open you can start the video.

Related

Windows interactive notifications

So I want to know how a quickreply toast can be sent to the right person and when you click on it, it goes to the specific person.
Example 1:
Person A texts me, I pull down on the interactive notification and type my response and it gets processed by the background process. How does the applications know that my response goes to Person A. is there an attribute in the XML of the toast that can be a variable, like the phone number?
Example 2:
Person A posts a picture on my facebook, I click on the notification and it takes me to the page on facebook. Again is there an XML variable with a URL of it or something?
You can download this Microsoft Windows UWP sample, where you can see what code they use to manage notifications.
I think that you need Toast notifications:
Toast notifications are small pop ups that appear on the screen for few seconds. They convey messages and can be customized to even play different sounds. New to Windows 10 are actionable toasts where a user has a choice to interact with the notifications by use of a button, for example.

UI Local Notification - Background Reschedule

I'm learning to develop application for ios with swift, and I'm one doubts, already googled and i not found.
I'm creating a to-do list app, and was wondering if there is a way to reschedule a notification when it appears to the user
For example the user registers a task every two hours, then the notification appears to the user and reagendo the new notification
Can anyone help me?
Thank you
You can't do it in background if your app is suspended. But UILocalNotification supports recurrent notifications.
All you have to do is to declare the recurring interval: notif.repeatInterval = NSDayCalendarUnit;
You can find more details here.
Note that you can't set custom intervals. You must use the default ones provided by Apple.

Reacting to UserAction in AudioPlayerAgent when app is suspended

I have an audio player that uses BackgroundAudioPlayer together with AudioPlayerAgent. Everything is working fine, except there's one use case I don't know how to handle.
If I play an audio track in my application and then the user switches to another application, the audio track continues to play in the background as it should - but I guess my application has now been swapped to memory and is suspended.
My question is: if the user now starts to play music in another app, I do get the AudioPlayerAgent.UserAction.Stop action as a callback to my AudioAgent. But can I do anything about this now from my app's point of view? I mean, I would like to save the position of the audio playback where the user was in my app, but my app has been suspended, right?
When my app is in the foreground and the audio stops, I do get the BackgroundAudioPlayer.Instance.PlayerState.Stopped event. It's here that I normally save the position of the playback. But if the user switches to another app to play music, I don't get this event.
So I am just wondering how to handle this kind of case. Is there anything I can do to improve the user experience?
The only way is to save that Position to Isolated Storage in the agent code.
See this very useful article of Paul about how to use Background audio agent and the way to communicate between UI and agent side

Can an app use both alerts and banners in Notification Center?

I am creating a Mac OS X application to use Notification Center. Some notifications should remain on the screen until the user interacts with them, and others should disappear shortly after displaying.
The NSUserNotificationAlertStyle key and changing System Preferences allow changing between banners and alerts. However, both approaches change all the notifications sent from my application.
Can I send some notifications as alerts and others as banners? If so, how?
NSUSerNotificationAlertStyle is the only way the developer can set the default notification style for the application, and it sets the style for all notifications from that app.
If you think it's really important for you to have 2 different kinds of notifications you can work around the problem by having a hidden helper application with a different NSUserNotificationAlertStyle than the main app.
Remember though you set the default notification style, but the user can change it whenever he wants in the notification center prefs, making your helper app useless.
No. The different notification types exist so that the user may select what he/she prefers, not so that the developer can.
If you feel your app should have this ability, you should file an enhancement request at http://bugreporter.apple.com and let Apple know.

RSS-reader feed updates when app is suspended

So, Ive made Windows Phone app that contains rss-feeds. I would now like to add the possibility for toasts to popup when a stream is updated. Ive read up on how to use Toasts to notify the user, but how can i make my rss-reader periodically poll the rss-feeds for the latests news when the app is suspended in the background. Example code would be highly appriciated!
Check the "Background Agent Sample" Windows Phone Code Samples to see how you can create a periodic background agent, that will allow you to pool the rss feed(s) and show a toast notification to the user!

Resources