位置跟踪窗口8 [英] Location tracking windows 8

查看:146
本文介绍了位置跟踪窗口8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理提醒,它也支持基于位置的提醒(例如,当你靠近你的房子时,它会告诉你关闭闹钟)。

我需要应用程序来检查位置,让每2分钟说一次(所以它不会耗尽电池太多)。



我应该使用哪种技术?我正在考虑敬酒通知,但这是为了提醒用户他正在接近该位置,但是需要有一个后台任务来检查位置,即使应用程序没有运行?



除了后台任务之外,还有其他技术我应该考虑吗? ,我会为你拍出一些很好的信息:

首先,频率

Windows 8后台任务可以基于时间触发。但是,支持的最短时间是15分钟。这意味着您的后台计时器无法以小于15分钟的频率更新任何内容。



尽管支持较低的时间,并且虽然您的后台任务将在设定的时间执行,任何低于15分钟的时间都不会重复。这是一次运行并完成操作。对于不了解15分钟规则的开发人员来说,这是一个常见问题。



您可能想要阅读以下内容: http://social.msdn.microsoft.com/Forums/en-US/ winappswithcsharp / thread / 9622daff-4cf7-4cb9-9f78-251ac4287cde

第二,首次使用,批准



开始使用设备的第一次调用必须在UI线程上进行,以便向用户显示同意提示。如果无法显示同意提示,则用户无法授予设备访问应用的权限。



引用: http://msdn.microsoft.com/ en-us / library / windows / apps / hh768223.aspx

第三,背景行为(只是你知道的)

阅读此:



如果Windows应用商店Windows 8的应用程序没有焦点,但它在后台暂停时不会收到位置更新事件。如果您的应用程序通过登录来跟踪位置更新,请注意这一点。当应用程序重新获得焦点时,它只收到新事件。


引用: http://msdn.microsoft.com/en-us/library/windows/apps /hh465148.aspx



更多背景任务信息: http://go.microsoft.com/fwlink/?LinkID=227329&clcid=0x409



以及这里: http://blog.jerrynixon.com /2012/08/windows-8-scheduled-tasks-lock-screen.html


Im working on a reminder which also supports location-based reminders (eg when you get near your house it tells you to switch off the alarm for example)..

I need the app to check the location lets say every 2 minutes (so it doesnt drain the battery too much).

What technology should I use? I was thinking about toast notifications but this is to remind the user the he is approaching the location, but there needs to be a background task which checks the location even if the app is not running?

Are there any other technologies apart from background tasks that I should consider?

解决方案

Since you appear to be new, I will shoot you some good info:

First, frequency.

A Windows 8 Background Task can be triggered based on time. However, the minimum time supported is 15 minutes. This means your background timer could not update anything at a frequency less than 15 minutes.

Although lower times are supported, and although your Background Task will execute at that set time, any time set lower than 15 minute will not repeat. It is a run once and done operation. This is a common problem for developers who don't know the 15 minute rule.

You might want to read this: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/9622daff-4cf7-4cb9-9f78-251ac4287cde

Second, first use, approval

The first call to start using the device must be made on the UI thread so that the consent prompt can be shown to the user. If the consent prompt can’t be shown, the user can’t grant device access to the app.

cite: http://msdn.microsoft.com/en-us/library/windows/apps/hh768223.aspx

Third, background behavior (just so you know)

Read this:

If a Windows Store app for Windows 8 doesn't have focus, it won't receive location update events while it's suspended in the background. If your application tracks location updates by logging them, be aware of this. When the app regains focus, it receives only new events. It does not get any updates that occurred when it was inactive.

cite: http://msdn.microsoft.com/en-us/library/windows/apps/hh465148.aspx

More Background Task info: http://go.microsoft.com/fwlink/?LinkID=227329&clcid=0x409

And here: http://blog.jerrynixon.com/2012/08/windows-8-scheduled-tasks-lock-screen.html

这篇关于位置跟踪窗口8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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