Reputation: 24005
I have noticed that when adding native support to a project in Eclipse, it generates a jni/libs/ folder. What is this folder and how is it used as I cannot find it in the NDK documentation.
From the NDK docs,
a copy of your prebuilt shared library will be copied into $PROJECT/obj/local, and another will be copied and stripped into $PROJECT/libs/(abi).
I notice that when a do an ndk-build
, this dir gets cleaned out and a few libraries are put in it. Yet, it usually is not the case that the libraries in $Project/jni/libs match $Project/libs. Also it seems that when I install an application, jni/libs is not referenced.
Is jni/libs just a temp folder used by ndk-build? Is it documented anywhere, or is this an vestige of using Eclipse for native support?
Upvotes: 3
Views: 9977
Reputation: 1031
jni/libs folder is where your shared library files are built from the C/C++ sources. Your native code gets compiled and depending on the value you had set in your application.mk file for the parameter
APP_ABI: = <all | x86 | armv7a | armeabi-v7 | mips>
the corresponding libs.so files are generated and places in jni/libs folder. These lib files are bundled to your final apk file and referenced by your app as and when needed. This is not a temp folder and the files from this folder does go into your final apk file.
Upvotes: 4