Forum > Android

Accelerometer

(1/1)

Daniello:
I'm trying to get access to the accelerometer. Since sensor.h was not translated to Pascal yet, I translated it myself. Here it is:
http://pastebin.com/Qb2Ke35L

However my application seems to crash when I call ASensorEventQueue_getEvents()
I'm not sure if I translated the ASensorEvent struct correctly, could anyone check?

felipemdc:
The LCL has support for accelerometer and the example application shows how to use it. It is in the Form2. I utilized JNI to implement it.

See the documentation: http://wiki.lazarus.freepascal.org/LazDeviceAPIs#Accelerometer

Daniello:
Thanks Felipe, I'll look into it :)

Navigation

[0] Message Index

Go to full version