SimpleBLE icon indicating copy to clipboard operation
SimpleBLE copied to clipboard

Add Android support

Open kdewald opened this issue 3 years ago • 3 comments

kdewald avatar Sep 27 '22 04:09 kdewald

Very much would like to see this...

ronaaron avatar Aug 09 '23 07:08 ronaaron

For this to happen, it would need some JNI code to call through to android BLE support, which all lives in Java / Kotlin land. The simplest way I can see to do this is:

  1. Build an android .aar or .jar which implements the bits of the BLE API needed here with JNI friendly callbacks. The callbacks in android BLE are all to classes derived from abstract base classes. Which you can't implement purely in C++ through java native because the methods aren't defined as native. So there needs to be some java code in the project (and the associated gradle build rubbish unfortunately...)

  2. Make a lightweight JNI wrapper in C++ for the aar to call through to this, which loads the android library and passes everything off to it (and receives callbacks through native implementations of callback classes).

I can see how this would be done, if I had more time I'd work on it, but I'm snowed under with paid work right now, and until someone asks me to port something with BLE to iOS, I will probably have to deal with my hacked together android specific BLE library for now.

joemarshall avatar Feb 28 '24 11:02 joemarshall

Hey all, thanks for reaching out. This is definitely becoming one of the first priorities once we get the new licensing stuff worked out. We're aiming to have a lot more resources going into this in the near future.

kdewald avatar Mar 03 '24 21:03 kdewald