Android Studio imports third-party so libraries

There are two ways to import:

1. Generally speaking, we do not need extra work to call the third-party so library, just put it in the specified directory, and then load it in the Java file.
For example, put the libFirstLib.so to be used under app/src/main/jniLibs/armeabi/ and refer to it in the source code:
static {  
    	System.loadLibrary("FirstLib");
    }


That's it.

2. Put the used jar and so package under the app/libs folder,
then modify the build.gradle file in the app directory, and add the following code under android:
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

That's it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326486518&siteId=291194637