我如何可以模拟加速度计在Android模拟器? [英] How can i simulate accelerometer in android emulator?

查看:625
本文介绍了我如何可以模拟加速度计在Android模拟器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有Android手机现在。但是,在我的应用程序需要使用加速度计值。所以,我需要一个能成为一个模拟器。我怎样才能做到这一点?

I don't have an Android phone right now. But in my application I need to use the accelerometer values. So I need an a simulator capable of it. How can I do this?

推荐答案

Android模拟器不支持它本身,而是OpenIntents软件的 SensorSimulator 填补的空白。下载并解压缩zip文件,然后启动独立jar文件:

The Android emulator doesn't support it itself but OpenIntents' SensorSimulator fills the void. Download and unpack the zip file, then start the standalone jar file:

$ java -jar bin/sensorsimulator.jar

接下来,安装使用亚行的工具,它自带的SDK模拟器上的SensorSimulatorSettings:

Next, install SensorSimulatorSettings on the emulator using the adb tool which comes with the SDK:

$ adb -s <emulator device> install bin/SensorSimulatorSettings.apk

(运行的 ADB设备的找到模拟器设备名称)。最后,运行在模拟器中安装SensorSimulatorSettings应用程序,并输入IP地址 10.0.2.2 (不管什么SensorSimulator应用程序可能暗示,这是一个别名发展主机的回环设备,以便始终应有效的。

(run adb devices to find the emulator device name). Finally, run the installed SensorSimulatorSettings app in the emulator and enter the IP address 10.0.2.2 (despite what the SensorSimulator application might suggest. This is an alias to the loopback device of the development host so should always be valid.

这篇关于我如何可以模拟加速度计在Android模拟器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆