0

I built a dynamic library (and a static) following the guide on https://wiki.openssl.org/index.php/Android

However, I am stuck now and I don't know what to do next. The next step in the guide is "Install the OpenSSL Library" which I did, and there were no errors. Next step is "Compile and Link against the Library" and I think this is the point where I need help with it, because I have to do it with the Android Studio 2.3.3

How can I make Android Studio 'find' the library and the header files location

Anyone can help?

Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
user3469811
  • 676
  • 1
  • 5
  • 17
  • 1
    Can't speak for Android Studio in the specific sense, but in general there is a configuration dialogue that allows you to point the IDE at libraries, headers, and other resources required for compiling and linking. The answers to this question may help you: https://stackoverflow.com/questions/25610727/adding-external-library-in-android-studio – user4581301 Jun 22 '17 at 23:27
  • Do you have a public source code repo? – Csaba Toth Jun 22 '17 at 23:54
  • 1
    Hi I had to make changes on CMakeLists.txt to give my IDE - as @user4581301 mentioned - an idea where to look for the relevant files. I found this project: https://github.com/googlesamples/android-ndk/tree/master/hello-libs, thank you! – user3469811 Jun 23 '17 at 00:23
  • @user3469811 great info, if you explain it with a little more sentences, including your gthub repo link it can be an accepted answer – Csaba Toth Jun 23 '17 at 02:17

1 Answers1

1

What you need to do varies on your actual project. Do you have a pointer to your own code?

The best advice I can give is to take a look at a project which also uses NDK. Here is FreeRDP which actually also uses SSL: https://github.com/FreeRDP/FreeRDP/tree/master/client/Android/Studio

You have to wire up stuff, take a look at the .h and .c files here https://github.com/FreeRDP/FreeRDP/tree/master/client/Android More importantly:

Follow some of these functions along the codebase. As for SSL in the end it doesn't matter as much how much you install it on your host development environment, but rather it matters how it'll be packaged with the Android app, and how it will be loaded. For example if you use OpenSSL as is, depending on the actual phone it may load the OpenSSL which is part of the system and not what is packaged with the app. https://github.com/FreeRDP/FreeRDP/issues/3631

Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
  • 1
    thanks for the Links to the project. Even though my problem is solved, I will take this project as an additional ressource for SSL-Topic, thank you! – user3469811 Jun 23 '17 at 00:30