Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Acquiring Sensor's data on Android Platforms

To read the sensor's data on an Android platform (i.e. Accelerometer, Gyroscope, Magnetometer, Barometer, GPS ), people over the internet are talking about two ways to acquire such data

  1. Primary way: reading the data using the Android SDK via JAVA.
  2. The 2nd way is related to reading the data using the Android NDK.

What about communicating with the sensors directly via SPI,I2C, or UART without the use of the SDK or the NDK ? I understand that I'll be burdened by understanding the communication protocol with the sensors and reading specific registers from which I can acquire the data in a more efficient way. Is this possible ?

like image 760
wfarid Avatar asked Nov 16 '11 16:11

wfarid


1 Answers

In theory it is possible, Walid. If you throw enough time and money at most technical problems, solutions become possible. But I would have to ask why anyone would want to do it that way?

It would be like saying "I'm pretty sure I can drive my car, inverted. I'll operate the accelerator and brake with my hands, and I'll add a couple of extra mirrors to reflect the windshield view down to me. And I'll steer with my legs. Don't ask me how I'll operate the horn!" It's just doing it at a goofy level.

You'd surely need details of the individual chips, which means you'd need to tear your XOOM apart - that kind of implementation info is not published. Not because it's a big secret, but because it keeps costs down if manufacturers don't publish info that 100% of consumers don't need.

Bottom line: there are more productive uses of your energy and brainpower.

Peter

like image 183
Peter vdL Avatar answered Sep 30 '22 17:09

Peter vdL