Android C++ Gesture Code

662 Views Asked by At

Is it possible to get gesture code to work with Android and C++? If so, how can it be done?

1

There are 1 best solutions below

0
On

The easiest way by far would be to pass the information from your MotionEvent and/or GestureDetector to your native code via the JNI. Exactly how you do this is up to you, but the basic principle is no different than that of any other communication between native and Java code.

If you are asking if you can acquire MotionEvents without going via the JNI, if it's even possible, it's far more hassle than it's worth. You could (and probably should) use a tool like SWIG to avoid the pain of writing JNI wrapper code manually.