# Android ndk library in ue4 c++ "sensor.h"

**URL:** <https://forums.unrealengine.com/t/android-ndk-library-in-ue4-c-sensor-h/338317>\
**Category:** Mobile\
**Tags:** libraries, unreal-engine, Android, UE4, CPP, question\
**Created:** [November 13, 2015, 12:45am UTC](https://forums.unrealengine.com/t/android-ndk-library-in-ue4-c-sensor-h/338317 "2015-11-13T00:45:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kbit](https://forums.unrealengine.com/u/kbit)\
**Post date:** [November 13, 2015, 12:45am UTC](https://forums.unrealengine.com/t/android-ndk-library-in-ue4-c-sensor-h/338317/1 "2015-11-13T00:45:24Z")

</div>

greetings

how can i add android ndk sensor library to my c++ code?

```
#include <android/sensor.h>

```

do i need to create a link to it?

what kind of parent class i should make for c++ to get the sensor data so blueprint can read it?

i’m not too familiar with c++

i want to get magnetic field sensor data that’s why i need this library.

thanks…🙂

\_\_k/bit

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [November 13, 2015, 4:13am UTC](https://forums.unrealengine.com/t/android-ndk-library-in-ue4-c-sensor-h/338317/2 "2015-11-13T04:13:48Z")

</div>

Just include should do i think as android headers and libs paths should be included via UBT when you compile for android, then you call functions from it normally anywhere you want, good if you do UObject wrapper. Just remember to isolate android code with (including include it self):

```
#if PLATFROM_ANDROID
...
#endif

```

or make wrapper in sperate module

---

<div class="post-metadata">

**Author:** ![kbit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kbit](https://forums.unrealengine.com/u/kbit)\
**Post date:** [November 13, 2015, 3:07pm UTC](https://forums.unrealengine.com/t/android-ndk-library-in-ue4-c-sensor-h/338317/3 "2015-11-13T15:07:21Z")

</div>

thank you .
