How to add external library aar and use function in c++ in android build

Hey!

I’m try to use Polar library for training stuff
Polar SDK | Polar Global
and access to their SDK is public
GitHub - polarofficial/polar-ble-sdk: Repository includes SDK and code examples. More info https://polar.com/developers

The SDK use ReactiveX
http://reactivex.io/
and I don’t know if I must to include this library also or not.

The first I am C++ and UE4 programmer for more than 6 years. But I don’t know Java and don’t know android programming. Project is for Oculus Quest 2, so, I build it for Android ASTC.

Really I even don’t know where to start.
What I did until now:
First I try to create new clean plugin for my project for this. I put aar inside lib folder, put some java from SDK source into UE4 plugin (I even don’t know which are important) as include. Then I check plugin WaveVR from HTC Vive plugin, because they have aar there. Copy UPL, change name and try to adapt. Then I was trying to do build, unpack APK, and check whether aar is included and androidManifest.xml modified.
But nothing happen.

I mostly working blindly on this. What I want to achieve is:

  • include Polar SDK as Plugin
  • inside this plugin have port to C++ for use this SDK (the best as Static ufunctions)

Where to start ?
How to do this properly ?
Maybe somewhere in the net is a good tutorial for using external aar library for android ?

There is port for ReactiveX for C++

but I don’t know if this is any help for me…

There is also ReactiveX port for UE4 based on C++ port, but is old and empty project

Please help me to sort out this external library problem.
If there is a possibility to understand how to do it without understanding of Android and Java programming will be great.

2 Likes