Getting sensor data on Android platforms

To read sensor data on an Android platform (for example, an accelerometer, gyroscope, magnetometer, barometer, GPS), people on the Internet talk about two ways to obtain such data.

  • Primary path: reading data using the Android SDK via JAVA.
  • The second method involves reading data using the Android NDK.

How to communicate with sensors directly through SPI, I2C or UART without using SDK or NDK? I understand that I will be burdened by understanding the communication protocol with the sensors and reading specific registers from which I can get data in a more efficient way. Is it possible?

+7
source share
1 answer

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

It would be like I’m sure I can drive an inverted car. I will control the accelerator and brake with my hands, and I will add a few additional mirrors to reflect the view of the windshield down and I will control my legs. Do not ask me how I will control the horn! "He just does it at the worst level.

You will probably need the details of individual chips, which means that you will have to tear your XOOM apart - such information about the implementation is not published. Not because it is a big secret, but because it reduces costs if manufacturers do not publish information that 100% of consumers do not need.

Bottom line: there is a more productive use of your energy and mental ability.

Peter

+1
source

All Articles