This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to control the sample rate of an acceleration sensor?

Zoltan Ackermann
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use the acceleration sensor of a Samsung i8910 from a Java MIDP application. I have implemented the DataListener interface found the Sensor, registered the listener and the application is receiving acceleration data.
The application receives a set of double values (X, Y, Z) once in a second, which is too rare for me. I would like to increase the sample rate somehow. It seems to me the buffer size has no (or no significant) effect on the call frequency. Additionally the received data does not reflect the latest acceleration values. If I turn the phone it takes approximately 10 seconds to get the correct values. It behaves like a rather slow built in filter. Although it might exist, I could not find a SampleRateControl either, which would make it possible to change the sampling frequency.
On the other hand I can check the acceleration sensor of the phone in test mode *#0*#, where I can see that its rather fast and responsive.

I would appreciate any idea for getting current acceleration data more frequently. I do not know if this is a phone specific or a general issue.
Thanks in advance for your support.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic