Hello Is there any example on using NDK to get sensors data via callback. Currently there is some sample code in the NDK, but it does not show how to use callback. I can't seem to figure out how to get the sensor data inside the callback. I only get 3 params, fd = file descriptor, events which identify the event, and data which is my private data pointer.
// Callback when we get sensor data ALooper_callbackFunc get_sensor_events(int fd, int events, void *data) { } int startNativeSensor() { ..... ..... // Create a sensor event queue from the sensor manager and register it with the // looper. This needs a callback method (e.g. get_sensor_events) which is called // when an event occurs g_engine.sensorEventQueue = ASensorManager_createEventQueue( g_engine.sensorManager, g_engine.looper, LOOPER_ID_USER, (ALooper_callbackFunc)get_sensor_events, data); .... .... -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en