Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to include .so files in Android Studio project

    • 0
    • 2
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 10.2k
    Comment on it

    From here you can learn to include or integrate .so files into your code. Files that contain the .so file extension are most commonly used for shared library files. Programs written in the C and C++ language load a shared library when they are launched on a user's hard drive.Therefore SO stands for Shared Object, it doesn't have anything to do with obfuscation, it just means someone wrote parts of the app in C.

    In some cases, there is existing C code and it's just easier for the programmer to build a JNI interface to call the library from Java; in other cases, the programmer wants the speed advantage that compiled C has over Java. And of course, if i want to hide how some part of my application works, writing that in C and compiling it to a .so makes it much harder to reverse.



    Well I have implemented this while I was integrating SQL Cipher in my application developing android studio. So below are the steps that I have followed for including .so files :-

    • create a folder named jiniLibs inside the main folder of application.
    • after you have to create three sub-folder inside jiniLibs named armeabi , armeabi-v7a and x86 . As the library loader will try to look for libraries that most closely match the architecture that you're running on. In general, you should compile one version of the library for each of the abis that you're planning to support (armeabi, armeabi-v7a, x86, mips) so that the compiler can optimize correctly.
    • And in these folder you have to copy the respective files that you are provided with. In my case I have generated these different versions with the help of commands provided library developers document.

    And in last you have to compile all the jars present in the code packet by including a line in the .gradle file of the app like the way it is added below :-

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')

    Well after lot of search I have came across this and it helps. Hope this will do the same for you. :)

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: