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

17,965

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/

Share:
17,965
yellow
Author by

yellow

Updated on June 04, 2022

Comments

  • yellow
    yellow almost 2 years

    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!