windows-phone-7 - 在 Wp7 中将重力与加速度分开(仅使用加速度 Api)

标签 windows-phone-7

我是 WP7 开发新手,正在开发一个项目(wp7 应用程序),我只需要使用加速 API 获得重力(我想我可以使用 Motion Api 做一些事情),但它需要窗口手机来支持指南针那么有什么方法可以将重力与加速度分开,或者仅使用加速度来获取 X、Y 和 Z 轴上的重力(因为我希望我的应用程序在没有指南针和陀螺仪的 wp 设备上运行)。

在android中还有一些方法,比如

  • 线性加速度
  • 低通/高通滤波器等 Wp7有这样的支持吗?

谢谢

最佳答案

手机本身并不知道什么力是由加速度引起的,什么是重力引起的。您需要来自其他传感器的信息才能进行数学运算以分离值。这就是 Motion API 的用途。

因此,您唯一的机会就是使用 Motion API。如果设备没有必要的传感器,它会优雅地掉落,但如果有:

The Motion API used by this sample requires all of the supported Windows Phone sensors, and therefore these sample applications will fail gracefully but will not work properly on devices without the necessary sensors or on the device emulator.

关于windows-phone-7 - 在 Wp7 中将重力与加速度分开(仅使用加速度 Api),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11794067/

相关文章:

windows-phone-7 - 使用 RestSharp 对 Trello API 进行身份验证

c# - 无法确定调用者的应用程序身份?

windows-phone-7 - Windows 手机操作系统 7.0 与操作系统 7.1

c# - 如何获取可用的支持语言列表并设置一个?

silverlight - 是否可以将客户端证书与来自 Windows Phone 7 的 HTTPS 请求一起使用?

xaml - 设置 CustomMessageBox 的 DataContext

c# - 在 Windows Phone 7 中异步接收 UDP 单播数据包的问题

silverlight - WP7 的文本框验证

c# - 立即返回 Task<bool>

c# - 无法分配给属性 'System.Windows.FrameworkElement.Style'(XamlParseException 未处理 :Windows Phone SDK)