首页 > 其他 > 详细

Integrating .so files into your APK

时间:2015-04-25 16:22:04      阅读:171      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!