Android JNI functions run on main thread?
android, android-ndk, java-native-interface
Solution
JNI calls are synchronous, like any other Java call, you can switch or spawn threads, but if you didn't specify it, they are executed on the same thread. So if you call a JNI function from the UI thread, it will be blocked until the function returns.
Problem
I have a doubt regarding JNI function calls made from Android. Do they run on the same thread as the Android app? Will the UI freeze if the native function is taking more time to run?