views:

129

answers:

2

Hello all,

To be able to do some accurate calculations that I want for my app, I need to be able to get an accelerometer reading every 100ms. I haven't found a way to do this on android, it seems like the only way to get accelerometer readings is to put a listener that can listen at different intervals. Basically, is there a way to get a reading at exact intervals?

-Jake

+2  A: 

I would register a Accelerator listener and then in the listener, I would read the system time and only if 1 second is passed, you can update you further methods.

Roflcoptr
Yeah, this works, I just didnt know if there was something already built in.
Jake Schwartz
A: 

Hi,

Put a Thread.sleep() in the listener to throttle down the readings. They run on a separate thread.

ognian