The easiest way is to pass information from MotionEvent and / or GestureDetector to your own code through JNI. Exactly how you do this is up to you, but the basic principle is no different from what is connected with any other message between native and Java code.
If you ask if you can purchase MotionEvents without going through the JNI, if possible, it's a lot harder than it costs. You could (and probably should) use a tool like SWIG to avoid the pain of manually writing JNI shell code.
source
share