Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I compile an existing C program for Android using NDK?

I am writing an Android app to test network performance, and I want to use iPerf in the app. I can find binary iPerf files already compiled for Android (and then I can run iPerf on the phone and collect its output) but I'm interested in compiling the files myself.

Here, someone presents scripts that can be used to compile the program: http://sourceforge.net/tracker/index.php?func=detail&aid=3533374&group_id=128336&atid=711373

I know that it requires the NDK but I don't know where to start. Are there any good resources or advice that can help guide me to compiling this on my own (on Windows, but I also have Cygwin). I know C and how to use GCC on linux, but I'm not sure where to start here.

Thanks for any help in advance!

like image 220
yellow Avatar asked Nov 03 '22 21:11

yellow


1 Answers

Here is a good discussion of getting started with the NDK.

https://stackoverflow.com/questions/5375453/looking-for-a-good-tutorial-on-android-ndk

If you work through the tutorial you will build your own NDK "Hello, World" sort of app. It's simple but it will help you understand the NDK.

Here's a direct link to the tutorial: http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/

like image 93
steveha Avatar answered Nov 09 '22 10:11

steveha