This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android NDK Support?

I need to write some code at the NDK level to access some Bluetooth features that aren't exposed at the Java level. For example, I want to have a 2nd bluetooth adapter on my Android device. I looked at the SDK download and the Github Android samples and there isn't anything obvious there to help. Is there any C code or SDK/API docs that can be used? I looked at getting the card and SDK from a supplier but they didn't know if there would be any Android driver support either, and suggested that I come here for guidance. Any ideas would be appreciated. Right now, I just building my application using generic code that accesses the bluedroid headers in the NDK, and it's very painful! Thanks.

  • I think you are taking the wrong approach, and have the wrong mindset, if you think you need multiple adapters to do RSSI triangulation. It is entirely possible to do RSSI triangulation with a single adapter, as long as you have multiple client units and each of them support stacked modes. And in that case, using the built-in BLE adapter [of the phone], you don't need the NDK at all, the entire app could be Java.

    BLE support in the core NDK does not exist. Bluedroid is not part of the core NDK. This is Android's fault not Nordic. So of course it is going to be a bit harder to use. Obviously, if you 'need' to add a second BLE adapter on the host side, you will definitely require use of this unofficially supported C / C++ API 'Bluedroid', so I can't ding you for that, but your premise for it is un-necessary. And if you otherwise need access to standard BLE from C use thunk.

Related