Android NDK and Bluetooth

I am new to android ndk. So, is it possible to work with bluetooth using Android NDK (same as SDK or similar) on unconfigured devices. If possible, give me a direction where I can find more information on this. Many thanks.

+3


source to share


1 answer


There is no direct access to the Bluetooth API from the NDK. The list of available NDK APIs is inside docs/STABLE-APIS.html

from the NDK archive.

But that doesn't mean you shouldn't be using Bluetooth from the NDK. You can directly call Java Android API and manipulate Java objects from C / C ++ using JNI.



JNI calls are quite tedious, so to keep them to a minimum, I would recommend that you write all the Bluetooth related code you need in Java as a Helper class and use JNI to call that helper from your C / C ++.

+6


source







All Articles