×
Namespaces

Variants
Actions

Talk:How to get accelerometer sensor values in Java ME

From Nokia Developer Wiki
Jump to: navigation, search

The *.JAR compilation fails when it is executed from a nokia 5800 xm anyway from "Start(int)" or "Start(double)". It said: "Exception in static initializer: java.lang.NumberFormatException


{{{width}}}
12 Sep
2009
Article Review by Larry101 (20090912)

The article provides a concise overview of how to obtain accelerometer data using the Java Mobile Sensor API. The basic steps involved in accessing the accelerometer data are outlined. These steps are then demonstrated through the use of a code example which demonstrates finding the accelerometer sensor, getting its URL, opening a connection and receiving data (both as integer and double primitive types).

The code examples are clear and to the point. The use of buffers to store accelerometer input and the subsequent averaging of the data stored in the buffers demonstrates a simple, yet effective means of smoothing accelerometer data (which is generally very "noisy" data). Such smoothing is essential in order to make effective use of input from accelerometer sensors.


 
×