This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Android and the fly likes Accelerometer Problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Accelerometer Problem." Watch "Accelerometer Problem." New topic
Author

Accelerometer Problem.

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
Hi Friends,

I am doing some stuff with accelerometer. I am able to access this sensor using Sensor Listener service.As you all know it gives three values X,Y and Z. Now what this values are.
I got some info from google. But still I am not sure about it.

Can anyone elaborate those three values to me? I want to detect that user is walking or not? I want to detect the distance the user has walked.

Please Help.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

I would suspect that the three values represent the acceleration in each of the three directions of a 3-D graph (you know, that boring geometry stuff you slept through in math class ;) ). My guess is that if you lay your phone flat, the X axis goes left/right relative to the device, the Y axis goes forward/backwards (or rather away from the top and bottom of the device), while Z is up/down (that is upwards from the screen or downwards from the back of the device). A simple app that displays the values should be able to verify this.

I google and found this post which seems to agree the directions: http://www.anddev.org/accessing_the_accelerometer-t499.html


JBoss In Action
Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
Thanks Peter...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accelerometer Problem.
 
Similar Threads
Wiimotes
Yield Method Purpose to allow other high priority threads?
Problem in detecting a shake movement
Android: Detecting "Shake" using accelerometer
G1 Magnetic Detection