是否可以在后台访问 Windows Phone 7 的加速计数据?

发布于 01-04 05:06 字数 328 浏览 1 评论 0原文

据我所知,如果屏幕锁定,加速计将停止报告数据。因此,您要么必须禁用屏幕超时并实现自定义锁屏,但这也不是完整的解决方案,因为用户可以切换到另一个应用程序并调用锁屏,这就是计步器在市场上如此稀缺的原因。但是,如果用户正在执行多任务处理,有什么方法可以让后台应用程序仍然能够报告加速度计数据呢?

我正在尝试设计一个计步器,从我阅读和研究的内容来看,在访问传感器数据时,多任务处理似乎不是一个选择。因此,如果我在前台有一个记录步数的计步器应用程序,如果我在走路时接到电话或决定阅读电子邮件或任何其他导致多任务处理的情况,传感器将停止报告数据,因为该应用程序使用它进入后台吗?有人可以帮我验证一下吗?或者让我知道是否有办法克服这个问题?

I understand that the accelerometer stops reporting data if the screen is locked. So you either have to disable the screen timeout and implement a custom lockscreen and that too isn't a full proof solution because the user could switch to another app and invoke the lockscreen, which is why pedometers are so scarce on the marketplace. However is there any way for an app that is in the background to still be able to report accelerometer data if the user is multi-tasking?

I'm trying to design a pedometer and from whatever I've read and researched, it looks like multi-tasking won't be an option when it comes to accessing sensor data. So if I have a pedometer app in the foreground that is recording steps, if I get a phone call or decide to read email as I'm walking or anything else that results in multi-tasking the sensor will stop reporting data since the app that uses it goes in to the background? Can someone verify this for me or let me know if there is some way to overcome this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

转角预定愛2025-01-11 05:06:57

有一组 API 不能被任何计划任务使用。使用这些 API 要么会导致运行时引发异常,要么导致应用程序在提交到 Windows Phone Marketplace 期间无法通过认证。有关受限 API 的列表,请参阅 Windows Phone 后台代理不支持的 API。

引自 Windows Phone 后台代理概述

Microsoft.Devices.Sensors:此命名空间中的所有 API 均不受支持。

引用自 Windows Phone 后台代理不支持 API

no

There is a set of APIs that cannot be used by any Scheduled Task. Using these APIs either will cause an exception to be thrown at run time or will cause the application to fail certification during submission to Windows Phone Marketplace. For the list of restricted APIs, see Unsupported APIs for Background Agents for Windows Phone.

Quoted from Background Agents Overview for Windows Phone

Microsoft.Devices.Sensors: All APIs in this namespace are unsupported.

Quoted from Unsupported APIs for Background Agents for Windows Phone

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文