Time for action – activating GNU STL in DroidBlaster

Let's activate and make use of the STL in DroidBlaster. Edit the jni/Application.mk file beside jni/Android.mk and write the following content. That's it! Your application is now STL-enabled, thanks to this single line:

APP_ABI := armeabi armeabi-v7a x86
APP_STL := gnustl_static

What just happened?

In only a single line of code, we have activated GNU STL in the Application.mk file! This STL implementation, selected through the APP_STL variable, replaces the default NDK C/C++ runtime. The following three STL implementations are currently supported:

  • GNU STL (more commonly libstdc++), the official GCC STL: This is often the preferred choice when using the STL on an NDK project. Exceptions and RTTI ...

Get Android NDK Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.