FAQ
I have one universal shared native library which is linked against
other shared library existing for various ARM versions and extensions.
I have to switch which one to use at runtime. My Android.mk is simple:

include $(CLEAR_VARS)
LOCAL_MODULE := player

LOCAL_SRC_FILES := some_cpp_sources...

LOCAL_LDFLAGS := -L$(LOCAL_PATH)/../bin
LOCAL_LDLIBS := -llog -lz -lm –lplayer_engine
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

include $(BUILD_SHARED_LIBRARY)

The problem is:

- I have to specify the native library (player_engine) - which the
main library depends on, at the link time
- I have more versions of the player_engine library
- Libraries must have same names; otherwise I would need to specify
all of them in the Android.mk script which would lead to
UnsatisfiedLinkError exceptions when trying to load only the correct
one according to the ARM version and extension

Build script creates only armeabi and armeabi-v7a subfolders in the
libs folder, any other manually created subfolder is deleted once the
apk is created.

How to solve this problem?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-ndk@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Search Discussions

  • David Turner at May 31, 2012 at 11:13 pm
    - Put your "engine" libraries as raw resources in your .apk. Only the
    "player" libs should go into libs/$ABI/ and will be installed by the
    PackageManager when your app is installed.

    - On first run, manually extract the right "engine" library to a fixed
    location (e.g. into Context.getFilesDir() + "/libplayer_engine.so"

    - On startup, after the step above, manually load the engine library by
    calling System.loadLibrary() with the full path to your extract lib

    - After this, load your "player" library with System.loadLibrary("player");
    On Thu, May 31, 2012 at 9:46 PM, Vitakot wrote:

    I have one universal shared native library which is linked against
    other shared library existing for various ARM versions and extensions.
    I have to switch which one to use at runtime. My Android.mk is simple:

    include $(CLEAR_VARS)
    LOCAL_MODULE := player

    LOCAL_SRC_FILES := some_cpp_sources...

    LOCAL_LDFLAGS := -L$(LOCAL_PATH)/../bin
    LOCAL_LDLIBS := -llog -lz -lm –lplayer_engine
    LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

    include $(BUILD_SHARED_LIBRARY)

    The problem is:

    - I have to specify the native library (player_engine) - which the
    main library depends on, at the link time
    - I have more versions of the player_engine library
    - Libraries must have same names; otherwise I would need to specify
    all of them in the Android.mk script which would lead to
    UnsatisfiedLinkError exceptions when trying to load only the correct
    one according to the ARM version and extension

    Build script creates only armeabi and armeabi-v7a subfolders in the
    libs folder, any other manually created subfolder is deleted once the
    apk is created.

    How to solve this problem?

    --
    You received this message because you are subscribed to the Google Groups
    "android-ndk" group.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to
    android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/android-ndk?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "android-ndk" group.
    To post to this group, send email to android-ndk@googlegroups.com.
    To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupandroid-ndk @
categoriesandroid
postedMay 31, '12 at 10:48p
activeMay 31, '12 at 11:13p
posts2
users2
websitedeveloper.android.com...

2 users in discussion

Vitakot: 1 post David Turner: 1 post

People

Translate

site design / logo © 2019 Grokbase