码迷,mamicode.com
首页 > 其他好文 > 详细

Integrating .so files into your APK

时间:2015-04-25 16:23:54      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

With the recent changes (release 0.7.3 around Dec 27), the new Android Build System starts to be really interesting also if you are using the NDK!

0.7.2Add jniLibs folder to source sets for prebuilt .so files.

Now this is really easy to integrate native libraries in your package and generate APKs for different architectures while correctly handling version codes (for more information on why this may be important, please refer to my first article).

 

If you are using Android Studio and need to integrate native libraries in your app, you may have had to use some complex methods before, involving maven and .aar/.jar packages… the good news is you don’t need these anymore 技术分享

技术分享

You only need to put your .so libraries inside the jniLibs folder under sub-directories named against each supported ABI (x86, mips, armeabi-v7a, armeabi), and that’s it !

Once it’s done, all the .so files will be integrated into your apk when you build it:

技术分享

If the jniLibs folder name doesn’t suit you (you may generate your .so files somewhere else), you can set a specific location in build.gradle:

 

android {
    ...
    sourceSets.main {
        jniLibs.srcDir ‘src/main/libs‘
    }
}

 

Via: http://ph0b.com/android-studio-gradle-and-ndk-integration/

Integrating .so files into your APK

标签:

原文地址:http://www.cnblogs.com/veins/p/4456061.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!