Linking Updated Android Library

I developed an application and my own library for Android. The native library uses openSL ES for sound processing.

In my Android.mk file, I have the following statement:

 LOCAL_LDLIBS := -lOpenSLES 

So, I assume that this means that the application will be dynamically linked in the openSLES library from the device / lib folder at the time the application loads / runs on the device ?

The problem that I am facing is that the libraries on the device are not working, and I have 3 updated libraries that contain a bug fix. If possible, how can I make sure that my native library uses 3 libraries that I have:

 Libwilhelm.so libOpenMAXAL.so libOpenSLES.so 

I just replace

 LOCAL_LDLIBS := -lOpenSLES 

with

 LOCAL_SHARED_LIBRARIES := -lOpenSLES -lOpenMAXAL -lwilhelm 
+6
source share
1 answer

While you are targeting a specific device or a very limited set of devices, the proposed solution is good enough. But if your goal is a public application that will be installed on different platforms, including the future version of Android N and customized ROMs, including, for example, Samsung, you should be careful with the system dependencies of these libraries.

Although OpenSLES and OpenMAXAL are innocent (they depend only on liblog and libwilhelm), the latter requires more caution.

Looking at Android.mk , libwilhelm depends on liblog libutils libmedia libbinder libstagefright libstagefright_foundation libcutils libgui libdl libeffects and libstagefright_http_support .

Only liblog and libdl are "official" (i.e. part of the NDK). Others are platform dependent, and their exported features may not be compatible for different devices running on the same platform level.

To be safe, I would only submit corrections and continue to use the system version of libwilhelm whenever possible. I hope you can reduce your system dependencies this way.

+4
source

All Articles