O'Reilly logo

Android NDK Beginner's Guide by Sylvain Ratabouil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – compiling Box2D and Irrlicht with the NDK

First, let's try to port Box2D on the Android NDK.

Note

The Box2D 2.2.1 archive is provided with this book, in directory Chapter09/Library.

  1. Go to http://www.box2d.org/ and download the Box2D source archive (2.2.1 in this book). Uncompress it into ${ANDROID_NDK}/sources/ and name the directory box2d.
  2. Create and open an Android.mk file in the root of the box2d directory. Save the current directory inside the LOCAL_PATH variable. This step is always necessary, because an NDK build system may switch to another directory at any time during compilation.
    LOCAL_PATH:= $(call my-dir)
    ...
  3. Then, list all Box2D source files to compile. We are interested in source file name only, which can be found in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required