Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenVPN and Android NDK

I have a custom made C (cross-platform) application. An OpenVPN variant. I want to compille this for the Android version with NDK.

It compiles under Linux. Does this mean i can easily compile it for Andoird too with the NDK? And if so, how can i communicate with my library through Java code (the normal Android SDK)?

I'm not really that far yet to do the actual implementation part. But i'd like to know what i can expect in advance.

So if you have any experience with the NDK and have any tips/pointers for me, then you'd really help me alot. Like, things i should look out for when working with the NDK. Compile settings etc.

Thanks for any help.

like image 282
Vivendi Avatar asked Aug 07 '12 09:08

Vivendi


People also ask

What is Android NDK used for?

The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.

What is Android NDK VS SDK?

Android provides Native Development Kit (NDK) to support native development in C/C++, besides the Android Software Development Kit (Android SDK) which supports Java. [TODO] more. NDK is a complex and advanced topics.

Do I need Android SDK and NDK tools?

If you are using the IL2CPP scripting back end for Android, you need the Android Native Development Kit (NDK). It contains the toolchains (such as compiler and linker) needed to build the necessary libraries, and finally produce the output package (APK).

What compiler does Android NDK use?

Code written in C/C++ can be compiled to ARM, or x86 native code (or their 64-bit variants) using the Android Native Development Kit (NDK). The NDK uses the Clang compiler to compile C/C++. GCC was included until NDK r17, but removed in r18 in 2018.


1 Answers

My Openvpn for Android application is open sourced. See https://github.com/schwabe/ics-openvpn/ Since you wrote that you are using an OpenVPN variant looking at the Android.mk files of my project might help you.

like image 193
plaisthos Avatar answered Sep 20 '22 14:09

plaisthos