--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
Tim
And each of those listeners would live at the Java level. You could
easily create a JNI "OnEvent()" function that your Java wrapper could
use to pass each event type to C++. And you COULD even create a thread
in C++ that could call "PeekEvent" to get an event from the queue (that
you're filling with your JNI callbacks), if you really had to. I'd hope
you're familiar with thread synchronization, though, since there are a
hundred ways to get it wrong. :)
Don't know if GLib requires that the C++ loop never exit, or if it can
be itself event driven; if the latter is true, then you'd be better off
writing it that way. In other words, if you can simply have Android/Java
call in to your C++ code for each event, including a screen draw, and
every time your C++ code exits back to Java (it doesn't get stuck in a
C++ "event loop" while the app runs), you'll have a much easier go of
it, not only because threaded code can be hard, but also because
threaded debugging on Android is broken at present, so you wouldn't be
able to use GDB to debug any of your code. :(
Tim