• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Develop in C/C++

Hi everyone,

My company has to develop an API library (.so) in C / C ++ on the Android platform. The library can be incorporated into other Apps also written with different Framework (Xamarin, Flutter, Native Java / Kotlin etc.). The library will use to communicate with our external device in Bluetooth (BLE). I have not found an example to start to set up a C / C ++ project and to be able to access Bluetooth from here.
Do you have any suggestions?
 
This link does a good job of getting native code set up. You can create a hello world c++ program from template that will get a string from the c++ side through the JNI. JNI is a bit tricky at first if you don't understand it. This spec can help: https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/jniTOC.html. I find googling what I'm trying to do works better at first. Once you get a feel for the JNI it is as easy as any other programming.

Here is the bluetooth documentation for native code: https://source.android.com/devices/bluetooth. I have no experience with that, so that is all the help I can give.

Hope this helps you.
 
Back
Top Bottom