By Shashwat Srivastava
In this post we will simulate various sensors such as accelerometer, compass, orientation and temperature sensor using SensorSimulator in Android SDK Emulator.
The OpenIntents SensorSimulator lets you simulate sensor data with the mouse in real time, where the behavior can be customized through various settings. It currently supports four sensors only but more are being developed by their team.
First you need to download the latest stable version of SensorSimulator. Go to their download page and then search for the latest sensorsimulator-x.x.x.zip file and download it. Right now the they have released the beta version and you can download it from here.
Note:
§ Here we will be working on Android Platform 1.5.
§ We have assumed that Android SDK's location in Windows is "E:\android-sdk-windows\". If you have installed/unzipped your SDK somewhere else, you can change this base-path accordingly in the rest of the tutorial.
Once you have downloaded the latest version of SensorSimulator uncompress it and go inside the bin folder. Here you will find two files sensorsimulator.jar and SensorSimulatorSettings.apk. Copy the sensorsimulator.jar file inside the tools directory of the Android SDK folder i.e. E:\android-sdk-windows\tools\.
Now we need to install the SensorSimulatorSettings.apk in Android SDK Emulator. You can read this tutorial if you need help with the installation of SensorSimulatorSettings.apk file. Follow the steps given in that tutorial and once you have installed we can proceed further.
Note: The above mentioned tutorial is for Android Platform 1.5 but it will work for other Android Platforms also.
Once you have installed the SensorSimulatorSettings.apk in Android Emulator click on the Launcher icon (emulator must be running right now and if not boot/start it up) as shown below.
A list of applications will appear now and Sensor Simulator setting application will be present in it. Open it.
Now minimize the Android Emulator and open command terminal inside Windows by going to
Start>>Run>>cmd. Inside command terminal change your current working directory to E:\android-sdk-windows\ and execute the following command as shown below.
java -jar sensorsimulator.jar
The moment you execute the above mentioned command sensorsimulator.jar will be launched.
Now enter the IP address in the Android Emulator as shown in SensorSimulator window.
After this select the Testing tab and then click on Connect as shown below.
Once you click on Connect button the Android Emulator will connect itself with Sensor Simulator (in Windows). Now a list of sensors will appear below Connect button. You need to Enable these sensors by selecting the checkbox present before each sensor name. They are disabled by default.
Once you enable them the sensor data will synchronize itself as shown below.
And now if you try to change position and orientation of the figure in the Sensor Simulator (in Windows) the values of all sensors will change accordingly in the Android Emulator. Thats it! We are done.
相关推荐
What you need to do in order to use the simulator instead of the android API, is to change the import from android.bluetooth to dk.itu.android.bluetooth (and also add the INTERNET permission in the ...
VCE Exame Simulator for android vce 模拟器安卓手机版破解 更新时间:2016-05-05 00:15:24 附件包含破解工具和说明文档 如有侵权麻烦告知会尽快删除 QQ/email:dydzdc@163.com
Wireless Sensor Network Simulator v1
WSN simulator; wirless sensor network simulator invisible & convinent
us从命令行启动Android Emulator和iOS Simulator。此cli为您提供了计算机上可用的虚拟设备的列表,其中最近打开的(来自cli)位于顶部。安装yarn global add emus或者npm install -g emus用法$ emus --help Start ...
Bradley Dupont Project Paper - Improving VANET Simulator in NS3.
This document contains documentation on how to use the LTE-A System Level Simulator (LTE-A SL Simulator) [1] as well as some insight on its structure and the assumptions that were made while ...
作者配合 Introduction to Network Simulator NS2 原书提供的课件。对原书内容进行了诠释。
Android模拟器访问本地Web应用 - hope it is help
Track driving simulator in MATLAB.zip
A quadruped robot simulator in MatlabSimulink
The CANopen Master Simulator is an easy to use software for data exchange with CANopen slaves of many suppliers via CANopen. Input data can be read and output data can be written with the currently ...
Installation goes in the following simple steps, and should be familiar since you have already installed Allegro: Start a console (e.g. a DOS-box in Windows) Make your Ellen directory to the ...
In part A we start with the basics: how to create a single compartment neuron model with Hodgkin-Huxley conductances, how to run the simulator and how to display the simulation results. In part B we ...
Dice Rolling Simulator in Python Free Source Code.zip
How to use all the features of the WatchKit framework in iOS 8. How to integrate your Watch app with its hosting iOS app and how to communicate between them. How to build a Glance for your WatchKit ...
Radio propagation: free space, two-ray, and lognormal shadowing Mobility: random waypoint model PHY: SNR-based packet capture, broadcast, dynamic transmission rate and power MAC: IEEE 802.11 (CSMA/CA,...
* How to embed maps with Map Kit and use in-application email * How to access a user's iPod library and integrate music into applications * Essentials of concurrent programming and advanced ...
ns-2 无线室内定位仿真拓展包的研究文档,能为希望深入了解NS2原理和使用NS2无线定位的读者提供一定的帮助