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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With