|
SensorSimulator
Sensor Simulator for simulating sensor data in real time.
The SensorSimulator drives your Android application in real time. Download it
About the SensorSimulatorThe OpenIntents SensorSimulator lets you simulate sensor data with the mouse in real time. Moreover, you can simulate your battery level and your gps position too, using a telnet connection. NEW! Now you can record a sequence with states from a real device. Also you can use features like editing, saving, loading and playing the scenario. It currently supports accelerometer, compass, orientation, temperature, light, proximity, pressure, gravity, linear acceleration, rotation vector and gyroscope sensors, where the behavior can be customized through various settings. Here you can find new features description. Download it from here
Connecting the SensorSimulator with the Android emulator
Note 1: Only these numbers are transfered between the SensorSimulator and the Android phone. These numbers are the same that you would read out in your application. Note 2: To change the enabled sensors, you have to disconnect and reconnect from the settings activity.
Recording in SensorSimulator from a real Android device
Note: Make sure that the Android device is in the same network with the java application (a wi-fi local network will do the trick). Also make sure that you have introduce the right IP for the java application in the Android Activity text box.
Quick Settings tabHere quick settings can be made for sensors that allow it.
Sensors Parameters tabHere you can find advanced details/settings about a sensor. By pressing the question mark, you can see interesting sensor information.
Telnet SimulatorTelnet simulator allows you to control the emulator gps position and the battery level.
Additional settings
How to use the SensorSimulator in your application
import org.openintents.sensorsimulator.hardware.Sensor; import org.openintents.sensorsimulator.hardware.SensorEvent; import org.openintents.sensorsimulator.hardware.SensorEventListener; import org.openintents.sensorsimulator.hardware.SensorManagerSimulator; mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); mSensorManager = SensorManagerSimulator.getSystemService(this, SENSOR_SERVICE); mSensorManager.connectSimulator(); @Override
protected void onResume() {
super.onResume();
mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);
mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD), SensorManager.SENSOR_DELAY_FASTEST);
mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_FASTEST);
mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_TEMPERATURE), SensorManager.SENSOR_DELAY_FASTEST);
}
@Override
protected void onStop() {
mSensorManager.unregisterListener(this);
super.onStop();
}class MySensorActivity extends Activity implements SensorEventListener{
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
public void onSensorChanged(SensorEvent event) {
int sensor = event.type;
float[] values = event.values;
// do something with the sensor data
}
}Note 1: The OpenIntents class SensorManagerSimulator is derived from the Android class SensorManager and implements exactly the same functions (see Android SensorManager). For the callback, the new SensorEventListener has been implemented that resembles the standard Android SensorEventListener. Note 2: Whenever you are not connected to the simulator, you will get real device sensor data: the org.openintents.hardware.SensorManagerSimulator class transparently calls the SensorManager returned by the system service in this case. Note 3: You can test the simulator with sensors applications from API Demos, after you modify their sources as described earlier. Sensor data definitionThe coordinate system with XYZ directions is defined as described in the Android SensorEvent reference. AccelerometerThe accelerometer values are defined in the accelerometer reference "Sensor values are acceleration in the X, Y and Z axis, where the X axis has positive direction toward the right side of the device, the Y axis has positive direction toward the top of the device and the Z axis has positive direction toward the front of the device. The direction of the force of gravity is indicated by acceleration values in the X, Y and Z axes. The typical case where the device is flat relative to the surface of the Earth appears as -STANDARD_GRAVITY in the Z axis and X and Z values close to zero. Acceleration values are given in SI units (m/s^2)." Magnetic field (compass)The magnetic field sensor values are defined in the magnetic field sensor reference "Sensor values are the magnetic vector in the X, Y and Z axis, where the X axis has positive direction toward the right side of the device, the Y axis has positive direction toward the top of the device and the Z axis has positive direction toward the front of the device. Magnetic values are given in micro-Tesla (uT)".
OrientationThe orientation sensor values are defined in the orientation sensor reference "Sensor values are yaw, pitch and roll Yaw is the compass heading in degrees, range [0, 360[ 0 = North, 90 = East, 180 = South, 270 = West Pitch indicates the tilt of the top of the device, with range -90 to 90. Positive values indicate that the bottom of the device is tilted up and negative values indicate the top of the device is tilted up. Roll indicates the side to side tilt of the device, with range -180 to 180. Positive values indicate that the left side of the device is tilted up and negative values indicate the right side of the device is tilted up." GravityThe gravity sensor values are defined in the gravity sensor reference The gravity sensor, as specified in the android documentation: "A three dimensional vector indicating the direction and magnitude of gravity. Units are m/s^2. The coordinate system is the same as is used by the acceleration sensor. Note: When the device is at rest, the output of the gravity sensor should be identical to that of the accelerometer." ProximityThe proximity sensor, as specified in the android documentation:
PressureThe pressure sensor values are defined in the pressure sensor reference Temperature
LightThe light sensor, as specified in the android documentation:
Linear AccelerationThe linear acceleration sensor, as specified in the android documentation: "A three dimensional vector indicating acceleration along each device axis, not including gravity. All values have units of m/s^2. The coordinate system is the same as is used by the acceleration sensor. The output of the accelerometer, gravity and linear-acceleration sensors must obey the following relation: acceleration = gravity + linear-acceleration" Rotation VectorThe rotation vector sensor, as specified in the android documentation: "The rotation vector represents the orientation of the device as a combination of an angle and an axis, in which the device has rotated through an angle ? around an axis <x, y, z>. The three elements of the rotation vector are <x*sin(?/2), y*sin(?/2), z*sin(?/2)>, such that the magnitude of the rotation vector is equal to sin(?/2), and the direction of the rotation vector is equal to the direction of the axis of rotation. The three elements of the rotation vector are equal to the last three components of a unit quaternion <cos(?/2), x*sin(?/2), y*sin(?/2), z*sin(?/2)>. Elements of the rotation vector are unitless. The x,y, and z axis are defined in the same way as the acceleration sensor."
GyroscopeThe gyroscope sensor, as specified in the android documentation: "All values are in radians/second and measure the rate of rotation around the X, Y and Z axis. The coordinate system is the same as is used for the acceleration sensor. Rotation is positive in the counter-clockwise direction. That is, an observer looking from some positive location on the x, y. or z axis at a device positioned on the origin would report positive rotation if the device appeared to be rotating counter clockwise. Note that this is the standard mathematical definition of positive rotation and does not agree with the definition of roll given earlier."
| ||||||||||||||||||||||||||||||||||











First, this is an excellent simulator. My only comment (and admittedly it is a weak complaint) is that it assumes that the accelerometer is dead center in the device (variations of Yaw have no affect on the accelerometer where pitch and roll remain constant). Of course, it may (albeit I would think somewhat unlikely) be that the device manufacturer will place the sensor dead center in the device. However, I would think it would be more useful to simulate it as if the sensor were placed in the front of the device. This way we could simulate a swinging motion common in alot of games. However, I realize this might be far more difficult to simulate:)
Thanks again for the sensor simulator. Great Job!
Excellent indeed. Proved very useful to check if my talking compass code worked as intended in the Android SDK 0.9 beta emulator. Thanks Peli!
I cannot get past the Connection Intent for the Emulator. Once finished and connected, I try to go back to my main activity, but it always takes me back to the Menu, can anyone help?
I am having the same problem. I added the following code and now instead of going to my app, it takes me to the Sesnsor Simlulator configuration screen. when I hit back, it takes me back to the menu. can anyone help?
nm, i looked at the source code and figured it out. you may want to note that Intent intent = new Intent(Intent.ACTION_VIEW, Hardware.Preferences.CONTENT_URI); startActivity(intent);
# and then
// first disable the current sensor mSensorManager.unregisterListener(mGraphView); // now connect to simulator SensorManagerSimulator?.connectSimulator(); // now enable the new sensors mSensorManager.registerListener(this,
gets called not on create but when a button gets clicked.
As some users described above i have the same problem when starting my own app. It just takes me back to the simulator screen. It happens at connectSimulator() Anybody know what im doing wrong or what causes this?
regards, Martijn
The problem can be that you are putting in the wrong IP address in the emulator. turn on sensorsimulator.jar & take your IP address from there. It might work. But I`m facing a different problem. When I click on connect, after a couple of minutes it gives an error message "activity sensor simulator (in application open intents ) not responding", anyone knows how to overcome this problem??
Cheers, Avinash Parnandi
I solved it by not starting the intent in my application. Just connect to the simulator using the OpenIntent? application via the Testing tab. Click the Connect button and data from the simulator should be coming in. Then close the application and start your own application.
My problem is solved and my app is working with the sensor simulator now and works great. The problem is that i didnt had the permission INTERNET in the configuration XML. The rest of the example given above works but just loose the Intent.
we are doing a project on all the sensors in android operating system.so we need some help from you about designing(usecase diagrams,sequence diagram..........) and the documentation of it.
If your program is closing without an error try placing
<uses-permission android:name="android.permission.INTERNET"/>
in your AndroidManifest?.xml directly after the <manifest> tag
:)
I was the preference/config screen then when I hit the back button it would close without a warning. When I finish a little app I will post.
I tried running the java application. I get the following error
Exception in thread "AWT-EventQueue?-0" java.lang.ClassCastException?: org.openintents.tools.sensorsimulator.MobilePanel?$2
Check your java version. Make sure it's 1.6
I am not getting a possible IP address from the Java app
hi, i have the same problem, it is going to directly my ip address again i click the back menu, it is going to main menu, can anyone help?
Hi,
- when I enter the IP and click on connect in Emulator, the Simulator on my computer can change the values of sensors; - when I hit "back" on Emulator, the Simulator shows that all sensors are disconnected.
Best regards
huckey
oh man yes... because i also look for two days how to solve.. i will AGAIN tell the solution of many probs here
add this in the androidmanifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
we are doing a project work on sensors in android operating system.so i have a problem with my Accelerometer that is ,it is not displaying the speed just it is displaying the values in the co-ordinate position.By using the Cordinate values we have to calculate the speed. so,it is making a disadvantage in my project, so suggest me to overcome this problem.
Hi,
I tried to port the openintents.apk on the Texas Instrument "Zoom" board. The board was uploaded with Kernel 2.6.27.10 & Android file system version 1.5.
Due to some reasons the openintents apk is not appearing on the device. However, the same apk is working fine on the emulator (with SDK 1.1 r1). Using ls command (to view the apks installed on the device) on PC connected to device, I do see the openintents apk, yet, its not visible on Zoom.
CAn you please help me with this??
Thanks.
Best Regards, Zhubham.
Hi,
I cannot access the Sensor Simulator settings in the Open Intents app on the emulator. When I select it, I get only a black screen. This is the logcat output:
I/ActivityManager?( 567): Starting activity: Intent { action=android.intent.action.MAIN comp={org.openintents/org.openintents.hardware.SensorSimulatorSettingsActivity?} } D/qemud ( 546): fdhandler_accept_event: accepting on fd 10 D/qemud ( 546): created client 0xc088 listening on fd 14 D/qemud ( 546): client_fd_receive: attempting registration for service 'sensors' D/qemud ( 546): client_fd_receive: -> received channel id 7 D/qemud ( 546): multiplexer_handle_control: unknown control message (26 bytes): 'ko:connect:07:service busy' W/ActivityManager?( 567): Launch timeout has expired, giving up wake lock! W/ActivityManager?( 567): Activity idle timeout for HistoryRecord?{436b1840 {org.openintents/org.openintents.hardware.SensorSimulatorSettingsActivity?}}
The versions I use: Android emulator version 1.9 (build_id CUPCAKE-147336) AVD Target: Google APIs (Google Inc.) Based on Android 1.5 (API level 3) OpenIntents 0.9.0
Any help would be greatly appreciated.
Thomas
When I use Android 1.1 (API level 2) as the target of my avd it works.
I get the following error on SDK 1.5 emulator (and OMAP 3430 as well). Can anyone tell how to come out of this??
D:\android-sdk-windows-1.5_r1\tools>adb install D:\openintents-binary-01?.9.0\openintents-binary-0.9.0\OpenIntents.apk 549 KB/s (1196340 bytes in 2.124s) DDM dispatch reg wait timeout Can't dispatch DDM chunk 52454151: no handler defined Can't dispatch DDM chunk 48454c4f: no handler defined
Failure INSTALL_FAILED_MISSING_SHARED_LIBRARY?D:\android-sdk-windows-1.5_r1\tools>
I get teh same error on the emulator: adb install OpenIntents.apk 295 KB/s (1196340 bytes in 3.954s)
Failure INSTALL_FAILED_MISSING_SHARED_LIBRARY?I use the SDK 1.5 r1 as well
Are there any solution?
If you're getting the MISSING_SHARED_LIBRARY problems, you need to use the 'Google APIs' target for your avd - this includes the Location libraries that are no longer built into the default.
What is the problem when I run SensorSimulator into my Android simulator? When I pulse on OpenIntents --> Settings --> Sensor Simulator, It doesn't work and screen changes a black color (as like as the application doesn't run well).
And the screen of your example (IP & port configuration), I haven't found.
Thanks a lot.
Hi again,
I forgot the next:
I'm using GoogleMaps? + Android Simulator 1.5.
Thanks!
Wonderful work!
Please someone can update this document with this two instructions:
First, the Target MUST be the Google APIs (Using 1.5 standard will cause instalation of OpenIntents.apk to fail).
Second, add this in the androidmanifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
To add use tag "Permissions" -> Add -> android.permission.INTERNET o just copy paste it before closing the manifest tag:
<manifest> .... <uses-permission android:name="android.permission.INTERNET"></uses-permission> </manifest>
Cheers.
I'm having the same problem as Paco. Where can I enter the IP and port???
When I pulse on OpenIntents --> Settings --> Sensor Simulator, the screen changes to black color and the emulator freezes.
(i) Can anyone please let me know the remedy of this??
(ii) Has it got something to do with the fact that Sensor and Compass APIDemo are failing on SDK 1.5 r1 emulator : refer http://groups.google.com/group/android-developers/browse_thread/thread/9f6c794b17eea701#
Thanks in advance.
Hi all, I have the same problem as sahilz750, Paco and finlaysoni, Is there any solution for that problem. For those that SensorSimulator works, which version of sdk and openintents do you use
I use Android SDK 1.5r2 with google apis and openintents 0.9.0 thank you for your Help
Hi guys, I'm using the latest version of the sensor somulator, and Android SDK 1.5r2. When I try to put in the IP address all I get is a blank screen. What can I do to fix this? Do I need a different version of teh SDK?
Hi all, I have executed on Android SDK 1.1. If you use Android SDK 1.5, Use Emulator on AVD for Android SDK 1.1 refer : http://developer.android.com/guide/developing/tools/avd.html
Works like charm, thanks for that great piece of software!will mention OpenIntents in my Software.
I have successfully used it for the android sample Compass.java ! But now I am using it with "SensorEventListener?" and i guess its not supported in "SensorManagerSimulator?"!
Will this simulator work with Android 1.5 (Cupcake) release. If not where can get some gaming application to test my accelerometer on cupcake.
Could you tell me how to save the data that I collected into a file? Thanks. ---- A new Androider
while i'm installing OpenIntent?.apk..its not getting loaded into emulator.. error message is shown in command prompt pkg: /data/local/tmp/OpenIntents.apk Failure INSTALL_FAILED_MANIFEST_MALFORMED D:\android-sdk-windows-1.5_r3\tool plz help.... thanks in advance
First of all, thank you for this simulator! But I have to ask you a question. I've upgraded my Android SDK to 1.6 version, and I've realized that the Sensor constant changed if I use the new Interface SensorEventListener? ('cause the old one says it's deprecated!). So, anyone knows if I could use the sensorsimulator with the new Interface or I have to use the deprecated one?? Thank you guys!!
I'd like to second the request to update the sensor simulator to new Android SDK 1.6/2.0 APIs. Thanks!
if I want to use my HTC magic to control the SensorSimulator on computer,can i?
+1 for updating the sensor simulator to the new Android platform and SensorEventListener?. (I just updated some other code for this change, so maybe I could do the same for SensorSimulator and submit a patch.)
Question: The instructions above say "download the latest openintents-binary-x.x.x.zip". I don't see any such thing on the openintents download list. Does sensorsimulator-1.0.0-beta1.zip replace that file?
Thanks, Lars
P.S. Thanks HastCibernio? for the tip about requiring the Google APIs as a target!
As Nicholaus said it would be great to have version for 1.6/2.0/2.1. Thanks
Is there any version to test applications with android 2.0 and SensorEventListener? ?
+1 for 2.0 API support
Yes, I get the same error as renijoym:
pkg: /data/local/tmp/OpenIntents.apk Failure INSTALL_FAILED_MANIFEST_MALFORMED?
Can somebody help me please!
I have just installed everything from their websites with the latest versions, from Java JDK, Eclipse, SensorSimulator, OpenIntents, etc... Even my winXP was recently installed a couple days ago!
I would also love a version that uses SensorEventListener? rather than the deprecated SensorListener?.
Are there plans for 2.0 API support? If so, when will this be available. Thanks!
Can someone suggest another simulator that is available for the current API? Thanks!
I would also like a non deprecated version of SensorSimulator.
+1 for an updated version
Hi developers! I understand your desire for an 2.0 API compatible version of SensorSimulator. Unfortunately, most of the OI developers are currently busy fixing bugs in the other OI apps, and there is a long list of feature requests as well: http://code.google.com/p/openintents/wiki/FeatureRequests
But that's not a big deal, because the SensorSimulator is open source :-) This means, you can help to contribute!
It should not be too difficult for any of you to write a basic wrapper of the new classes (that calls back the old classes behind the scenes). If someone makes a basic start, we can refine and correct that.
If you are interested in contributing, let's discuss the details in our developer group: http://groups.google.com/group/openintents
This would be the fastest way for you to get the 2.0 API implementation.
I still cannot connect to the local port !
I have the INTERNET permissions in the Manifest file but it keeps saying it can't connect. If I telnet to the port, I see its open and there. Also, I can browse on the emulator.
What am I doing wrong? :-( I really need it for an AR application.
got it!!
loopback for your own machine without using direct IP is 10.0.2.2
The sensor data defintion isn't compatible with API 2.0. Hope to get the latest one.
It would be more than awesome if this can work for me, however, I'm recieving this error, can anyone tell me what I'm doing wrong?
Cannot cast from SensorManagerSimulator? to SensorManager? and for Hardware.mContentResolver = getContentResolver(); I'm getting; Hardware.mContentResolver = getContentResolver();
thanx a lot!
Does anyone has any guide on how to make sensor simulator work on Froyo, i can't even connect application to emulator. Ty for any positive feedback
Hi! I'm trying to run SensorSimulatorSettings? on real device(Android 1.5, HTC Hero). But i get error with database...some SQL exception or something like that...Is there any posibility to run that on real device, and if anyone have any idea about this problem i would be very gratefull...
Thanks
Hmmm. I am trying to use it but
sm = SensorManagerSimulator?.getSystemService(this, SENSOR_SERVICE);
throws exception. I 've added the <uses-permission android:name="android.permission.INTERNET"/>.
What could be wrong ?
Thanks.
I've tried just to run the simulator and install & run OpenIntents.apk. In the result was the exception
After that application falls into infinte loop of restarting and closing with error. So I'm wondering how the gps is related to sensors simulation...
I want to try to update this to work with the new 2.0 API, but I can't find the source code. Where would I go about getting it?
It doesn't work with new API mostly cause of changes that are introduced to Sensors. I have already done some modifications and currently got stuck because of SensorEvent?. If you really want to give it a try, contact me on mail and i can give you a help.
guys,i am new to android development .... I have a need to simulate the real time movement of the android device... suppose, the user holding the android device moves, the location attributes should change immediately in real time... Is it possible to simulate this need using the SensorSimulator software ???
Hi, cannot connect to sensorsimulator... i have this error appearing on debug information:
I/Hardware( 375): Connecting to 127.0.0.1 : 8020 E/Hardware( 375): Couldn't get I/O for the connection to: 127.0.0.1 : 8020 E/Hardware( 375): --------------------------------------------------------------- E/Hardware( 375): Do you have the following permission in your manifest? E/Hardware( 375): <uses-permission android:name="android.permission.INTERNET"/> E/Hardware( 375): --------------------------------------------------------------- I/AndroidRuntime?( 375): AndroidRuntime? onExit calling exit(1) D/Zygote ( 30): Process 375 exited cleanly (1) I/ActivityManager?( 66): Process org.openintents.sensorsimulator (pid 375) has died.
When i click connect, the application simply closes... why does this happens? I'm sure to have sensorsimulator listening on correct port, and i also have this in manifest file: <uses-permission android:name="android.permission.INTERNET"/>
Any help?
Thanks
Hello,i have a question regarding the sensor simulator...
Is it possible to simulate the movement of the android device using sensorSimulator?? for example,if i select the "move" option in the sensor simulator and move the device, the co-ordinates of the current position of the device should be available to me .... Is this possible ??? if possible,which option will give me the co-ordinate position(Accelerometer or compass) ??
Great software I'm sure.. I couldn't find openintents that would run on my Android 2.1
Why o why does it all have to be so cryptic as to where to download files....
Hello, i have a problem using sensorSimulator. If in my code i register only a sensor, all works fine. If i register more than one sensor (for example orientation and accelerometer), my application is stopped with this exception:
01-25 13:06:12.521: ERROR/AndroidRuntime?(409): FATAL EXCEPTION: main 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): java.lang.RuntimeException?: Unable to start activity ComponentInfo?{it.unipr.android.sensori/it.unipr.android.sensori.SensorActivity?}: java.util.NoSuchElementException? 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.app.ActivityThread?.performLaunchActivity(ActivityThread?.java:2663) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.app.ActivityThread?.handleLaunchActivity(ActivityThread?.java:2679) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.app.ActivityThread?.access$2300(ActivityThread?.java:125) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.app.ActivityThread?$H.handleMessage(ActivityThread?.java:2033) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.os.Handler.dispatchMessage(Handler.java:99) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.os.Looper.loop(Looper.java:123) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.app.ActivityThread?.main(ActivityThread?.java:4627) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at java.lang.reflect.Method.invokeNative(Native Method) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at java.lang.reflect.Method.invoke(Method.java:521) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at com.android.internal.os.ZygoteInit?$MethodAndArgsCaller?.run(ZygoteInit?.java:868) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at com.android.internal.os.ZygoteInit?.main(ZygoteInit?.java:626) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at dalvik.system.NativeStart?.main(Native Method) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): Caused by: java.util.NoSuchElementException? 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at java.util.ArrayList?$ArrayListIterator?.next(ArrayList?.java:576) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at org.openintents.sensorsimulator.hardware.SensorSimulatorClient?.enableSensor(SensorSimulatorClient?.java:447) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at org.openintents.sensorsimulator.hardware.SensorSimulatorClient?.registerListener(SensorSimulatorClient?.java:262) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at org.openintents.sensorsimulator.hardware.SensorManagerSimulator?.registerListener(SensorManagerSimulator?.java:164) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at it.unipr.android.sensori.SensorActivity?.onCreate(SensorActivity?.java:40) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-25 13:06:12.521: ERROR/AndroidRuntime?(409): at android.app.ActivityThread?.performLaunchActivity(ActivityThread?.java:2627)
what's the problem?? this is my code:
public void onCreate(Bundle savedInstanceState) {
@Override
can anyone help me?
thanks! Laura
Hello all,
I've hacked up a version of the simulator that works with the more recent 2.0 API. I'll be cleaning up the code and will post a patch soon.
Edward
Where can i find this "Enable Sensors" button that i'm supposed to press? I can't seem to find it...
Nice application!
Is there any way to add a third tab into the simulatorsettings with a different activity?
Someone needs to put a big notice on this page that the simulator does not work on 2.1 apps. I'm relatively new at Android so I'm running the latest SDK and just spent a day trying to get the simulator to work. Sounds like Edward might have a fix nearly ready to go and I'm anxiously awaiting it.
Brilliantly useful. Thanks!
Someone knows a simulator does work on Android 2.2 ?
Thank you! got it working exactly how i need it to. great program
thank you! works perfectly.
thank you very much. Very very useful tool.
Do someone know a software which allows you to pass sensor-data from a real phone to the SDK, or would it be possible to develop an android version of the server application so you could do that with Sensor Simulator???
hello i have the same problem as laura... if only one sensor/listener is registered everything works fine, but if there are more sensors/listeners it doesn't work.
Uncaught handler: thread main exiting due to uncaught exception java.lang.RuntimeException?: Unable to bind to service de.ostfalia.android.carblackbox.TrackingService?@44c46738 with Intent { cmp=de.ostfalia.android.carblackbox/.TrackingService? }: java.util.NoSuchElementException?
android.app.ActivityThread?.handleBindService(ActivityThread?.java:2816) android.app.ActivityThread?.access$3300(ActivityThread?.java:119) android.app.ActivityThread?$H.handleMessage(ActivityThread?.java:1920) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loop(Looper.java:123) android.app.ActivityThread?.main(ActivityThread?.java:4363) java.lang.reflect.Method.invokeNative(Native Method) java.lang.reflect.Method.invoke(Method.java:521) com.android.internal.os.ZygoteInit?$MethodAndArgsCaller?.run(ZygoteInit?.java:860) com.android.internal.os.ZygoteInit?.main(ZygoteInit?.java:618) dalvik.system.NativeStart?.main(Native Method) Caused by: java.util.NoSuchElementException? java.util.AbstractList?$SimpleListIterator?.next(AbstractList?.java:61) org.openintents.sensorsimulator.hardware.SensorSimulatorClient?.enableSensor(SensorSimulatorClient?.java:447) org.openintents.sensorsimulator.hardware.SensorSimulatorClient?.registerListener(SensorSimulatorClient?.java:262) org.openintents.sensorsimulator.hardware.SensorManagerSimulator?.registerListener(SensorManagerSimulator?.java:164) de.ostfalia.android.carblackbox.sensor.SensorProviderSimulator?.start(SensorProviderSimulator?.java:102) de.ostfalia.android.carblackbox.TrackingService?.startService(TrackingService?.java:143) de.ostfalia.android.carblackbox.TrackingService?.onBind(TrackingService?.java:120) android.app.ActivityThread?.handleBindService(ActivityThread?.java:2804)
thx 4 ur help with regards Frank
@rallyelgen: I was thinking of something on these lines too; it would involve the same concepts as the Sensor Simulator, transmitting sensor data via sockets using telnet. I'll let you know if I make any headway with this.
Hi Frank, You could file a bug report here: http://code.google.com/p/openintents/issues/list detailing your problem. We'll try to resolve it at the earliest.
Does it works on Android OS Ver. 2.3.3? I run it on Nexus S but the sensor values are not updated. Both connection and enable/disable are okay. but the sensor values are not updated. does anybody who had tried to run it on Nexus S w/o any problem?
How do you enable comments in your googlecode site? I'm not able to get it work.
> How do you enable comments in your googlecode site?
Administer > Wiki > Visitor comments > Allow visitor comments.
This looks like a great tool, but I'm having a hard time getting started. The emulator won't connect to the SensorSimulator java app. I do not get an 'Enable' button and when I click Connect, it responds but stays on and the Disconnect button does not enable. Both apk files installed with 'Success', the SensorSimulator seems fully functional.
I'm using Windows 7 x64, Android 2.1.1, sensorsimulator 1.1.1 I've tried... Emulator with/without eclipse With firewall turned off (bitdefender IS 2010) With wireless and wired internet connection 198.162.1.x (local IP) and 127.0.0.1 (localhost) Port 8010 and port 80 (no IIS running) ping of IP works netstat -a shows a result of "[::]:8010" as Listening java app shows 'Listening on port 8010...' in it's dialog
Any suggestions?
Some of the text in the prior post got garbled. The results of the netstat was open square bracket colon colon close square bracket colon 8010. Not sure why there was no IP address indicated in the brackets.
Ok. I figured it out. It had to do with the text input for the IP address. When I used either my local keyboard, or the keyboard that pops-up on the android screen, the dot (period) appears to be a double byte character. If I use the keyboard on the right panel, it works correctly.
I can't get this to work. Settings installs, Simulator connects. But demo fails. It appears to be caused by Instrumentation onCreate. Does anyone see a solution?
E/AndroidRuntime?( 345): FATAL EXCEPTION: main E/AndroidRuntime?( 345): java.lang.NoClassDefFoundError?: org.openintents.sensorsimulator.hardware.SensorManagerSimulator? E/AndroidRuntime?( 345): at org.openintents.samples.SensorSimulatorDemo?.SensorSimulatorDemoActivity?.onCreate(SensorSimulatorDemoActiv? ity.java:67) E/AndroidRuntime?( 345): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) E/AndroidRuntime?( 345): at android.app.ActivityThread?.performLaunchActivity(ActivityThread?.java:1611) E/AndroidRuntime?( 345): at android.app.ActivityThread?.handleLaunchActivity(ActivityThread?.java:1663) E/AndroidRuntime?( 345): at android.app.ActivityThread?.access$1500(ActivityThread?.java:117) E/AndroidRuntime?( 345): at android.app.ActivityThread?$H.handleMessage(ActivityThread?.java:931) E/AndroidRuntime?( 345): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime?( 345): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime?( 345): at android.app.ActivityThread?.main(ActivityThread?.java:3683) E/AndroidRuntime?( 345): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime?( 345): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime?( 345): at com.android.internal.os.ZygoteInit?$MethodAndArgsCaller?.run(ZygoteInit?.java:839) E/AndroidRuntime?( 345): at com.android.internal.os.ZygoteInit?.main(ZygoteInit?.java:597) E/AndroidRuntime?( 345): at dalvik.system.NativeStart?.main(Native Method)
hi please find the code below.Here it works fine which diplays 0.0 in the text field. but when i try to run it by making necessary changes as mentioned above to connect to sensor simulator it is not running ...please help me...package com.android.mindtree;
import android.app.Activity; import android.os.Bundle; // import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent?; import android.hardware.SensorEventListener?; import android.hardware.SensorManager?; import android.widget.; //import org.openintents.sensorsimulator.hardware.Sensor; //import org.openintents.sensorsimulator.hardware.SensorEvent?; //import org.openintents.sensorsimulator.hardware.SensorEventListener?; //import org.openintents.sensorsimulator.hardware.SensorManagerSimulator?; //import android.view.View;
public class AccelerometerActivity? extends Activity implements SensorEventListener?{
}hi all, i have written code to print the values returned by accelerometer.It returns by default the valuse 0.0 , 9.88 , .88 for x,y and z axis respectively.As i have not used any sensor simulator the value remains same..but as discussed above i used sensor simulator( Replaced Sensormanager by SensorManagerSimulator?) but its not returning any value mot even 0.0...in the mean time i noticed that when i keep cursor on any function related to sensormsnagersimulator it shows the following message( This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.)..but all other functions properties and functionalities are displayed as soon as i move cursor over to that....so i think the problem lies in that itself...i have even added external jar file also...still the problem persists...please anybody help me in sorting out this problem...
Hi everyone ! First of all, thank you for your tool which is great. Actually, i've managed to modify an android app to use sensorsimulator, and it's working fine when I simulate some sensors from the server. But I'd like to be able to get the real sensor datas when the app is not connected to the server. As it is written in the documentation, I removed the connectSimulator() call in my code, but i don't get any data ! Should I do anything else ? Thanks in advance for your help.
What a great idea this is. Too bad we have to modify the source code in the application to either work with real sensors or this sensor simulator. Is there any discussion with google android emulator development team to incorporate this simulator into the standard SDK?
How/Is it possible to use the Simulator in Android NativeActivity??
How can I Install bin/SensorSimulatorSettings?-x.x.x.apk on my Android emulator.I am using windows 7.
Hi does SensorSimulator communicate to the android browser? I have javascript that uses acceleromater and window.orientation and I'm not seeing the changes I expect.
Hey is it possible to have two instances of Sensor Simulator connecting to a app running on 2 Emulators so that i can uniquely give motion events to each of the Emulator ?