How to run application in background in Windows Phone?
Asked Answered
W

4

9

I want to develop a background application in Windows Phone 8. Like there is a flash screen and after the flash screen starts, immediately it would be moved to back ground.

But the timer present in the application should be active from being in background and keep doing the task assigned. So, in the fore ground user can continue using the device and in background the app will run a timer and continue with the tasks.

I have tried using Periodic tasks, but they get triggered once in 30 minutes and more. But I want this app to be triggered once in 20 seconds.

Kindly help me with some ideas.

Whoever answered 22/11, 2012 at 13:45 Comment(2)
Unfortunately, your application is unable to operate in the background any more than once every thirty minutes and for 25 seconds at a time. msdn.microsoft.com/en-us/library/hh202942%28v=VS.92%29.aspxOphthalmologist
See #8353015.Deshawndesi
R
14

WP7/WP8 don't allow for full multitasking in the background for arbitrary apps. Whatever it is you're trying to accomplish will either have to be achieved in some other way or just not done on windows phone. There's lots of alternative as you've found out: WP7.5 Alarms & Reminders, WP7 Scheduled Tile updates, WP7.5 Periodic Background Agents, Resource Intensive Background Agents, WP8 Geolocation tracking apps, WP7 Push Notifications and more.

The zen of WP7/8 Multitasking is to keep phones healthy both from a battery perspective, memory usage perspective and other resources as well. So, no full background multitasking. Although WP8 improves there with Geolocation tracking apps and Fast Application Resume.

Ream answered 22/11, 2012 at 22:33 Comment(2)
Now that you have closed my other question (thanks) can you at least answer me if FTP can be done in the background every minute and how?Vibraharp
I already read and knew about how to implement the Background agents, but that was not what I asked.Vibraharp
S
0

Windows Phone supports single MainApplication View and Background agents. If you want to do any application like "screenrecording" it is not possible because of security reason and because of battery reason. But if you are able to make your own Webservice, it should be easy to catch the situation by streaming data via Streaming agent.

Here some sample of agents.

Channel 9

Microsoft.Phone.BackgroundTransfer Namespace

Adding a Windows Phone Background Agent to an XNA Game

Windows Phone 7 Background Agents (CSWP7ScheduledTaskAgent)

Sloshy answered 23/11, 2012 at 12:55 Comment(0)
D
0

For exemple: https://code.msdn.microsoft.com/windowsapps/Background-sensors-eb7bb176

you need create an new project from template "Windows Runtime Component"

sorry my English.

Dilution answered 27/9, 2015 at 4:9 Comment(0)
G
-1

You could enable or disable applications to run in background:

Goto Settings > battery saver > usage > tap on application > On/Off Background

Few applications are always runnable in background by default, for whose it's disabled like Phone, FB Messenger, etc. If you really feel that, it should be in background, better please uninstall it.

Hope it helps.

Garbo answered 27/10, 2014 at 21:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.