Downloading your own shared library from another Android application

I need to distribute an application (player), which depends on my own library created for this version of ARM and the extension (Tegra, Neon). This native library is quite large, so I can not distribute all its versions in one universal package. Therefore, I decided to split the application into one small universal .apk and more specialized .apks - plugins without any action.

How can I access a custom proprietary shared library in a pluggable application from the main host application? Can I just use

System.loadLibrary("path_to_library"); 

If so, how can I get the path to this library?

How to solve this problem if this is not possible?

+4
source share
1 answer

System.loadLibrary() takes the name of the library and somehow maps it to the full path.

foo => libfoo.so

The system usually checks apk itself, and then usually /system/lib/

If you have the full path, use System.load()

In any case, it will be difficult for you to control the location of your lib if it is not in apk or with all system libs.

I would just pack a specific library with apk.

+1
source

Source: https://habr.com/ru/post/1415952/


All Articles