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/

  • 相关阅读:
    常用FPGA功能块记录
    鸿蒙相关
    微波相关
    Python库大全
    C#环境实现代码的自动生成编译
    STM32相关
    硬件相关
    C# 获取枚举中文注释
    C# 获取自定义特性值
    Asp.Net Core 中 Host 与 WebHost的区别
  • 原文地址:https://www.cnblogs.com/veins/p/4456061.html
Copyright © 2011-2022 走看看