windows phone can be set time interval of running in background? - c#

I tired to searching of this question. Every time i search, it also showing that
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.
Windows phone app like skype, facebook, Whatsapp. These type of application are running in background and update notification every minute. Why the periodic agent typically run every 30minutes? then how these app to update the notification to alert user in the short period time eg: few minutes?
Thanks for your helps.

These applications are using push notifications to update the tiles. This is a message from a web server sent to the phone which the WP7/8 OS processes without the need for the app to run in the background.

Related

How to set daily toast in app

I wrote a Windows Phone 8.1 (WINPRT) App. One of the features of this app is alarm/reminder.
For Example: user sets the Reminder at 7AM in app's Reminder Page. App must give alarm/reminder daily at 7AM. Now as I got to know, that alarm and reminder are not available in Windows Phone 8.1, so I thought of using Toast.
How will this app give a toast at user set time everyday.?
Also, how to make this app run in background for this purpose.
Any other better solution for this problem?
If your app is running a background process, it will be invoked every 30 minutes or so. You won't be able to get it to send out a toast notification exactly at 7am as far as I know, but you can get it within 15 minutes or so of 7am.
You can also schedule a toast notification to occur. Details here.
Have you looked into this?
https://msdn.microsoft.com/en-us/library/windows/apps/hh202965%28v=vs.105%29.aspx?f=255&MSPPError=-2147217396
I think this might answer your question

make countdown when app is not active windows phone

I want to make a countdown timer (lets say 20 min.) for my windows phone application. But it should still be counting down, even if the application is not active.
For example: user clicks a button, then this button should not be available for 20 min. Even if the app is restarted, the phone is restartet or whatever.
How should i basically approach this? Is the background agent the way to go? Make some kind of periodicall shedule? Or read the phone clock?
Or are there other possibilities?
It should also not be easy to avoid (for example change the time on the phone, so that it is 20 min. later on the clock)
Has someone an idea? just searching for a point in the right direction here :).
Thanks
If you don't trust the phone to provide the time of record, the obvious answer is to use a remote time server to mark application activation time according to the remote server. If you also mark the local phone time at activation and calculate the difference between the two, you can use that difference to store what the remote server would (ideally) believe to be the current time that the button is pressed without having to call the remote server again.
One example of such a service is http://www.timeapi.org/utc/now.

WP8 timer app under lock screen

I have app with dispatcher timer. User set some interval(for example 30 sec) and press button start. App Each 30 sec play sound. All work ok. But when User lock phone timer stopped and nothing played. Can I play sound each 30 sec when phone is locked?
It is possible to keep the app running under lock screen.
Using Idle Detection, you can keep the app on, although screen is locked. Actually, it is not running in background, but in the foreground. Just the screen is locked. So, be careful not to drain user's battery.
You have to set the PhoneApplicationService.ApplicationIdleDetectionMode property to Disabled, for example in InitializePhoneApplication() method in App.xaml.cs:
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
Note that there are special certification requirements for this type of apps. Refer to section 6.3 (Apps running under a locked screen) of the following page:
Additional requirements for specific app types for Windows Phone
yes.
sure..
You can use the Scheduled Task Agent in windows phone.
using the Scheduled Task Agent, when you app is not running or stopped (not in background).
you can fire your Events.
For that you have to add the scheduled task agent into your project.
And in the ScheduledAgent.cs file find the OnInvoke method and put your code here.
this method performs the task in Background. (Means the code is executed when your phone is locked).
for more Reference click here Implement background agents for Windows Phone
I hope you get the destination. Now, just put that code into your application and its working.

run task on specific time in windows phone 7

Can we run some task on specific time in background if my application is running or on dormant state. Is this possible in windows phone 7.5 Mango. If Its not possible then any work around with the help of push notifications.
If you are not the currently active application in Windows Phone your application is being tombstoned, which means that some of your state is saved and your application is halted (e.g. there is no code running for your application anymore).
Therefor you can not create code that allows your application to do anything at a specific time, without using push notification.
Even with push notification your options are very limited. It realy depends on what you want to happen when a notification arives.

How to set the expiration of a background task agent in windows phone 7 to never expire?

I am designing an application where the user selects the option to update his live tile and can forget about the app. Once he picks the option to update, I kick off a background task agent. But it looks like as per msdn, the background task agent will only run for upto two weeks.
How do I fire it again without having the user to come into the app?
It's not possible to run a Background Agent without rescheduling it every 14 days. Moreover, if the phone is in the battery-saving mode, it may not run the agent. So, you should find a better way to update the tile (Tile Push Notification).
Or, if you want to go with the Bckground Agent, the day before expiring, update the tile saying that the user should open the app to continue getting the tile updated. But, if he info is useful, the user will tap on the tile to get more info.
This has changed in Windows Phone 8. If the user has chosen your app for any of the lockscreen settings (Background, Content, or Status) the app will continue to run after the two weeks without the need for a launch by the user.
So if you have an application that the user decides to use as a part of their lock screen you are ok.
Otherwise I would go with setting a reminder the day you are going to expire. Each time the app is launched delete the reminder and make a new one two weeks out.
I also liked one of the comments above to change your tile status to "Launch me to get more updates".

Categories

Resources