zoukankan      html  css  js  c++  java
  • Integrating .so files into your APK

    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 :)

    jniLibs

    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:

    fatbinary

    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/

  • 相关阅读:
    linux软件安装
    [vim]使用中问题
    [vim]常用命令
    server
    linear regression
    loss function
    new bird in github
    [bzoj3489]A simple rmq problem
    [Jsoi2015]字符串树
    luogu3899谈笑风生
  • 原文地址:https://www.cnblogs.com/veins/p/4456061.html
Copyright © 2011-2022 走看看