brucko
brucko

Reputation: 361

Referencing .so files from an Android library

I've built OpenSSL into an Android Library that I would like to reference from another Android project.

Unfortunately,

  1. Yes, I do need OpenSSL, as I need to change the behaviour of dependant Android classes not in the public API. (not enough space here)
  2. My experience with native code is non-existant.

Built files in OpenSSL Android library project

The project is selected as a library in Preferences > Android

enter image description here

This library is referenced from a second Android project

enter image description here

My Questions are these

  1. How can I reference the .so files in my Android library from Android.mk in my second project so that I can build dependant files there? I'd prefer not to put the .so files directly in my second project - but if that is the only solution I would accept reasons and directions as an answer.
  2. How should I include/reference the .so file in files I am building in the second project?

Surely, it is something simple.

Thanks in advance.

Upvotes: 1

Views: 2495

Answers (1)

once you generate (.so) library file, then make a folder in your applitcation's project folder named "libs/armeabi/" put (.so) file in this folder

and in your application write

System.loadLibrary("library_name");

Upvotes: 2

Related Questions