如何在 Windows Phone 后台运行应用程序? [英] How to run application in background in Windows Phone?

查看:29
本文介绍了如何在 Windows Phone 后台运行应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Windows Phone 8 中开发一个后台应用程序.就像有一个闪屏一样,闪屏启动后,它会立即移到后台.

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.

我曾尝试使用周期性任务,但它们会在 30 分钟或更长时间内触发一次.但我希望这个应用每 20 秒触发一次.

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.

请帮助我一些想法.

推荐答案

WP7/WP8 不允许任意应用在后台进行完全的多任务处理.无论您要完成什么任务,要么必须以其他方式完成,要么就不能在 Windows Phone 上完成.您发现有很多替代方案:WP7.5 报警和提醒,WP7 计划的磁贴更新,WP7.5 周期性后台代理,资源密集型后台代理,WP8 地理定位跟踪应用,WP7 推送通知 等等.

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.

WP7/8 多任务处理的禅意是从电池角度、内存使用角度和其他资源角度保持手机健康.因此,没有完整的后台多任务处理.尽管 WP8 改进了 地理位置跟踪应用程序快速申请简历.

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.

这篇关于如何在 Windows Phone 后台运行应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆