Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Georgy Treshchev edited this page Feb 21, 2022 · 14 revisions

Android Native Documentation

Android Native is a plugin that makes it easy to call Java functions via JNI.

How to install

Select and download the release for the required engine version, extract the archive into your plugins project folder to get the following path: "[ProjectName] / Plugins / AndroidUtils".

Basic internal description

The plugin uses JNI (Java Native Interface) to communicate C++ with Java.

Java method call example

Java:

@Keep
public class DeviceInfo {

    @Keep
    public static String GetUniqueID(Activity activity) {
    	return Settings.Secure.getString(activity.getContentResolver(), Settings.Secure.ANDROID_ID);
    }

}

C++:

FString UniqueID = AndroidNativeUtils::CallJavaStaticMethod<FString>("com/Plugins/AndroidNative/DeviceInfo", "GetUniqueID", FAndroidGameActivity());
Clone this wiki locally