How do I add android sdk functionality to UE4 game

I am currently developing a game in UE4 for andorid. I am extremely familiar with making android application using the android SDK and ecilipse in java. I also have a good idea of what NDK is and why it is used but I don’t know where it hooks up with UE4

However I want my game to use some of the functionality that is present in the android SDK !
For example when player does a certain action the vibrator must turn on or for another action the LED lights must glow or say I want to get readings from phone sensors or I want the game to download some custom data from a server ! all these were extremely easy to do with SDK and java but I am using UE4 because I want its powerful game architecture and renderer so I can’t leave UE4.

In short I want a UE4 game that can also use the android API functionality.

Also I noticed there was a eclipse release build downloaded along with other things in TADP tools! what is that for?

HAAALP! So far from what I found there is a file named AndroidJNI.cpp in the engine source on git which looks like the entry point for the UE4. So to use that for my libraries I’ll have to build the engine from source for each project where i want to use a different external library. Is that the recommended way to do this? or there is some better way I’ve overlooked?

Hi.

Basically, without sources You won’t be able to do this. But if you have sources you can add Java functionality pretty simple.

The JNI file is under *Engine\Source\Runtime\Launch\Private\Android* path, the java file under *Engine\Build\Android\Java\src\com\epicgames\ue4*

You can check how AndroidThunkCpp_IsMusicActive is made, or if you need native callback from java, the Java_com_epicgames_ue4_GameActivity_nativeSetGlobalActivity method.

The only difficulty is that all JNI is in Launch module, that has no access to other modules than Core, Engine, etc (you can check the Launch.Build.cs for details). So if you want to add another module that needs Java native callback to work you should use FCoreDelegates class to communicate with them.

The Eclipse in TADP is only for people who haven’t had Eclipse already. It’s pretty bundle with all you need to work with UE4 on Android :wink:

Actully theres java portion in laucher version too and copy of it is always placed in project directory Intermediate\Android\APK letting you modify it (i think :p)