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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.