如何在 ViewSonic 平板电脑上实施传感器管理器?
我最近购买了一台运行 Android 2.2 的 ViewSonic G 平板电脑,用于开发应用程序。
我有一些应用程序使用传感器管理器来读取手机的方向值。我已经在几款不同的 Android 手机上测试了这些应用程序,它们工作正常(找到传感器并输出值)。
但是,当我在 G 平板电脑上测试应用程序时,没有发现方向传感器?我不知道为什么会发生这种情况,我想知道是否有人知道什么会导致这种情况?
顺便说一句,平板电脑还预装了一些使用传感器的其他应用程序,并且它们工作正常!?
预先感谢您的帮助!
I have recently acquired a ViewSonic G Tablet running Android 2.2 for the development of applications.
I have a few applications that use the Sensor Manager to read the orientation values of the phone. I have tested these applications on a few different android phones and they work fine (the sensors are found and the values are output).
However, when I test the applications on the G Tablet, no Orientation sensor is found?? I have no idea why this might be happening, and I was wondering if anyone has any clue what would cause this?
By the way, the tablet has a few other pre-installed applications that use the sensors and they work fine!?
Thank you in advance for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
定向需要加速度计和磁力计结合两个传感器来提供上/下和横向定向。也许您的平板电脑只有一个加速度计。这应该足以确定向上/向下的方向,您应该直接访问加速度计。
Orientation requires both accelerometer and magnetometer combines both sensors to give an up/down and lateral orientation. Perhaps your tablet only has an accelerometer. This should be sufficient for determining which way is up/down, you should access the accelerometer directly.