0

首先,我正在尝试使用适用于 Android 的“Openintents Sensor Simulator”程序。我为桌面安装了传感器模拟器。之后,我在我的 Android 模拟器上安装了 SensorSimulatorSettings-xxxapk。在 android 模拟器的设置页面上,我使用 10.0.2.2 和我的本地 IP 地址和套接字号 8010。

当我尝试在 android 设备上运行我的程序并尝试在桌面应用程序中控制传感器时,它根本没有改变。当我尝试在桌面程序中旋转虚拟电话时,“方向”、“重力”和“加速度计”参数发生了变化。但是android模拟器中的程序不使用这些参数。

PS:程序在真正的 android 设备上正常工作。仅不适用于虚拟 android 模拟器。

例如:当从 x 轴旋转时,程序打印“你向右转”或从 y 轴旋转,程序打印“你转起来”。

4

2 回答 2

0

I've recently ran into issues with the OpenIntents Sensor Simulator. Seems that the project hasn't been touched for 3 years, and since their last development effort, Android changed how you are allowed to access the Network. As a result, any work with the library results in NetworkOnMainThread errors.

于 2013-12-11T01:53:20.340 回答
0

尝试这种替代方法:http ://tools.android.com/tips/hardware-emulation

于 2013-12-05T17:57:14.283 回答