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 – drawing a tile-based background

First, let's embed RapidXml library to read XML files:

  1. Download RapidXml (version 1.1.13 in this book) at http://rapidxml.sourceforge.net/.

    Note

    RapidXml archive is provided with this book in the Chapter6/Resource folder.

  2. Find rapidxml.hpp in the downloaded archive and copy it into your jni folder.
  3. RapidXml works with exceptions by default. As we will study exception handling later in this book, deactivate them in jni/Android.mk with a predefined macro:
    ...
    LS_CPP=$(subst $(1)/,,$(wildcard $(1)/*.cpp))
    LOCAL_CFLAGS    := -DRAPIDXML_NO_EXCEPTIONS
    LOCAL_MODULE    := droidblaster
    LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH))
    LOCAL_LDLIBS    := -landroid -llog -lEGL -lGLESv1_CM
    ...
  4. For efficiency reasons, RapidXml ...

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