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 are supported.
- STLport (a multiplatform STL): This implementation is not actively maintained and lacks some features. Choose it as a last resort. Exceptions and RTTI are supported.
- Libc++: This is part of LLVM (the technology behind...