是否可以在后台访问 Windows Phone 7 的加速计数据?
据我所知,如果屏幕锁定,加速计将停止报告数据。因此,您要么必须禁用屏幕超时并实现自定义锁屏,但这也不是完整的解决方案,因为用户可以切换到另一个应用程序并调用锁屏,这就是计步器在市场上如此稀缺的原因。但是,如果用户正在执行多任务处理,有什么方法可以让后台应用程序仍然能够报告加速度计数据呢?
我正在尝试设计一个计步器,从我阅读和研究的内容来看,在访问传感器数据时,多任务处理似乎不是一个选择。因此,如果我在前台有一个记录步数的计步器应用程序,如果我在走路时接到电话或决定阅读电子邮件或任何其他导致多任务处理的情况,传感器将停止报告数据,因为该应用程序使用它进入后台吗?有人可以帮我验证一下吗?或者让我知道是否有办法克服这个问题?
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 技术交流群。

不
引自 Windows Phone 后台代理概述
引用自 Windows Phone 后台代理不支持 API
no
Quoted from Background Agents Overview for Windows Phone
Quoted from Unsupported APIs for Background Agents for Windows Phone