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

**URL:** <https://forums.unrealengine.com/t/how-to-add-external-library-aar-and-use-function-in-c-in-android-build/255982>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [October 15, 2021, 12:52pm UTC](https://forums.unrealengine.com/t/how-to-add-external-library-aar-and-use-function-in-c-in-android-build/255982 "2021-10-15T12:52:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wab11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wab11](https://forums.unrealengine.com/u/wab11)\
**Post date:** [October 15, 2021, 12:52pm UTC](https://forums.unrealengine.com/t/how-to-add-external-library-aar-and-use-function-in-c-in-android-build/255982/1 "2021-10-15T12:52:49Z")

</div>

Hey!

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

The SDK use ReactiveX  
[http://reactivex.io/](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++

> **[ReactiveX](https://github.com/ReactiveX)**
>
> Reactive Extensions for Async Programming. ReactiveX has 42 repositories available. Follow their code on GitHub.

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

> **[GitHub - Polterageist/UE4RxPlugin: Unreal Engine 4 wrapper for a RxCPP...](https://github.com/Polterageist/UE4RxPlugin)**
>
> Unreal Engine 4 wrapper for a RxCPP library (https://github.com/ReactiveX/RxCpp) - GitHub - Polterageist/UE4RxPlugin: Unreal Engine 4 wrapper for a RxCPP library (https://github.com/ReactiveX/RxCpp)

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.
