Toast notification interval time on windows phone 8 - windows-phone-8

I'm going to make a simple toast notification using periodic task of background agent, what I'm asking is how can I show deep toast notification in specific time (ex:5 mins). Note: We have used this method ScheduledActionService.LaunchForTest(string name, TimeSpan delay) to check in Emulator.
Is this will work in Device with customized time interval?
Please help me.

Periodic agents typically run every 30 minutes. To optimize battery
life, periodic agents may be run in alignment with other background
processes and therefore the execution time may drift by up to 10
minutes.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202942%28v=vs.105%29.aspx#BKMK_ConstraintsforPeriodicAgents
You can however send a toast via push notification service. You can do that whenever you want.

Related

App Termination Event WP8.1

I am developing a WP8.1 app in which I need to get the time when app terminated so that when it's launched again I can take decisions according to my requirements. But for this I'm unable to find the any kind of termination event for app where I can store the time of app termination. I have searched and have found Windows Phone 8.1 App Life Cycle which shows there is no event for termination. So my question is how can I record the time of app termination?
You can handle the suspension of the application, when it is brought to the background, and record that time. It is the time when the user last used your app, so when it is started again, you can check how much time has elapsed since last use.
For the actual termination you do not receive an event, nor it is a way to handle such event, because all processing in the application is stopped when suspended and no code can execute.

How can I schedule a Background Task to trigger at a specific time

This is a Windows Phone 8.1 app. I want to be able to trigger a task to execute at a specific time. My main concerns are accuracy, resource and user experience.
I have tried a TimeTrigger with an IBackgroundTask but found that, aside from the minimum 15 minutes constraint, the execution time is far from accurate - sometime the task triggers 8 minutes later, some times 20 so no use for a scheduled trigger.
I have looked at toast but I need the task to run without user input and, as far as I can see, the toast notifications have no capability to trigger code execution without the user interacting.
I have looked at the alarm clock approach but, firstly it uses toast notifications and, secondly, I understand you can only have one alarm app that the user must declare so that's a bit intrusive.
I have looked at using a Task.Delay approach using async and await to avoid blocking the UI thread but this is hardly a background-centric approach.
Has anyone managed to find a way to create resource-friendly, scheduled background tasks (i.e. an alarm and sleep function) for Windows Phone 8.1?

Windows Phone: Is it possible to mix toast notification and scheduled alarm?

I'm new to Windows Phone development. I'm going to implement reminder App with following features:
Remind every day/week/month
When remind occurs display it in notifications list
And I've got problem with it:
Alarms / Remind API is pretty good for my task. But it doesn't
create notification (I wanna see my remind in notifications list)
ScheduledToastNotification creates notification but it has too many schedule limitations
How to create correctly scheduled alarm + Toast notification?
Unfortunately when it comes to exact timed notifications, those are your only two options.
A possibility would be to use the regular Reminder and create the Notifications silently (without showing the toast popup). Won't be very reliable though.
If you can live with varying timings, you can try:
You could check out TimerTrigger but it has a lot
of limitations either.
In Silverlight Background Agents may work
for you (max. every 30 Min)

Windows Phone 8 - Keeping background location tracking active beyond four hours

I'm in the process of developing a WP8 app that makes use of the background location tracking abilities provided by the OS. The idea is to monitor the users position and to notify them when they are near certain types of places.
So far it all seems to work fine and when running the location tracking works as I would expect.
The problem is, it seems that the phone times out background apps after around four hours, stopping the location tracking.
I can understand why Microsoft did it, to preserve battery life etc. But there's not much point having a background location tracking app that has to be manually restarted every four hours! If a user chooses to run this app and is made aware of the potential battery hit, surely it should be able to run indefinitely - to a point of course, if the system runs out of resources or similar then that's fair enough.
Does anyone have any experience with this? There must be hundreds of others apps in the store that have run into this issue I would have thought? And presumably there must be some way of keeping the location tracking running?
I've tried periodically updating the live tile (using a DispatcherTimer) while the tracking is running but this doesn't seem to be enough to keep the app alive either :(
Anyone have any ideas?
Thanks.
There is no way to achieve your desired behavior. The app will be deactivated under anye of following conditions:
The app stops actively tracking location. An app stops tracking location by removing event handlers for the PositionChanged and StatusChanged events of the Geolocator class or by calling the Stop() method of the GeoCoordinateWatcher class.
The app has run in the background for 4 hours without user interaction.
Battery Saver is active.
Device memory is low.
The user disables Location Services on the phone.
Another app begins running in the background.
Source: Running location-tracking apps in the background for Windows Phone 8
What you could do is to show a toast notification before app is deactivated advising the user, and make him navigate back to the app, extending the period for other 4 hours that way.
There is no way to keep it running without any user interaction.

Stop Google Analytics Realtime tracking on Adobe AIR app after closing?

I'm using Adobe's Google Analytics SWC library for flex. What I'm trying to achieve is to simply be able to utilize the realtime features of Google Analytics to know when users have my AIR desktop application open.
Making it detect an open application was easy enough. I can visually see the count on Google Analytics getting updated in a matter of seconds whenever I open up my application. However, the problem occurs when I close my app. Google Analytics doesn't seem to detect a closed app and still detects it as open on the realtime view. How would I go with making Google Analytics know that the application has stopped?
So far, it seems the realtime counter only reverts back to 0 after some 30 or so minutes that I have already closed the app. This leads me to believe that it was considered to be idle by Google and so decided to update the statistics. That might be good and all but I really want to utilize the realtime capability so I need it to reflect when an app closes with only a few seconds of offset.
Any thoughts?
Not sure if this one will work (don't know that Android will kill the process and restart it each time) but if it does it's an answer:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeApplication.html#event:exiting
Also check out the Deactivate event as it seems to be relevant, more on mobile app life cycle here:
http://help.adobe.com/en_US/air/build/WSfffb011ac560372f82c4ee412b1275403b-8000.html
From the Google Analytics documentation.
setSessionTimeout () method public function
setSessionTimeout(newTimeout:int):void
Sets the new session timeout in seconds. By default, session timeout
is set to 30 minutes (1800 seconds).
Session timeout is used to compute visits, since a visit ends after 30
minutes of browser inactivity or upon browser exit.
If you want to change the definition of a "session" for your
particular needs, you can pass in the number of seconds to define a
new value.
This will impact the Visits reports in every section where the number
of visits are calculated, and where visits are used in computing other
values.
For example, the number of visits will increase if you shorten the
session timeout, and will decrease if you increase the session
timeout.