How to create ThirdParty for Android with shared (.so) library within

Hello, again!

I’m no very familiar wih Android development. At this moment I have NDK shared library(.so), header files for it (.h), and .jar library. I don’t have linux library (.a). So, this pack of files is enough to create ThirdParty for Android? I already create few ThirdParty for Win, with static and dynamic libraries, but I have no idea how to do same for Android. Can i use PublicDelayLoadDLLs for “.so”?

Solved. There is no way to create ThirdParty for android using Java libs. It’s only C++.

Instead, i can edit “UE4 Java Activity”, e.g. “Engine\Build\Android\Java\src\com\epicgames\ue4\GameActivity.java” and include into it whatever i need. Also, for we must edit “Android.mk”.

In “Android.mk”:

include $(CLEAR_VARS)
LOCAL_MODULE := Vuforia-prebuilt
LOCAL_SRC_FILES = C:\NVPACK\vuforia-sdk-android-3-0-5_0\build\lib\armeabi-v7a\libVuforia.so
LOCAL_EXPORT_C_INCLUDES := C:\NVPACK\vuforia-sdk-android-3-0-5_0\build\include
include $(PREBUILT_SHARED_LIBRARY)  

In “GameActivity.java”:

import com.qualcomm.QCAR.QCAR;

And in end “load library” section:

static
{
	System.loadLibrary("Vuforia-prebuilt");
	System.loadLibrary("UE4");
}

And ofcourse create “Java/libs” folder and put *.jar into it.

Finally with connected lib (tested - all is OK) i can use JNI methods to access Java from C++. There are still a lot of work: per class C+±>Java communication and engine-dependend template creation. Have something to do for few next weeks.

Did you get any results?

I have to work with vuforia, but i reaaaally don’t like unity compared to UE, and unreal4ar doesn’t really cut it once you know how vuforia works.

How have you approached the camera and target image prefabs absence?

Thanks for your insights :slight_smile:

Almost same here. I am trying to load some dynamic external library. I have .so and .h for function signatures and .aar , but for the life of me i can’t figure out how to link it to the packaged .apk . Your answer is outdated a bit, can anyone please share link to documentation how to do it at least on 4.16 pls?