Android jniLibs
时间: 2023-11-02 22:43:58 浏览: 126
Android JNI (Java Native Interface) allows Java code to interact with native code written in C/C++. JNI libraries, also known as jniLibs, are native libraries that contain the implementation of the native methods declared in the Java code. These libraries are packaged as shared libraries (.so files) and placed in the jniLibs directory under the app module.
The jniLibs directory should have subdirectories for each target architecture that your app supports, such as arm64-v8a, armeabi-v7a, x86, x86_64, etc. Each subdirectory should contain the appropriate shared library file(s) for that architecture.
During the app installation process, Android automatically loads the appropriate jniLibs for the target architecture of the device. Then, when the Java code calls a native method, the JNI loads and executes the corresponding function from the jniLib.
It's important to make sure that the jniLibs directory contains the correct shared library files for each architecture that your app supports, otherwise the app may crash when running on devices with unsupported architectures.
阅读全文