Method:
1. Create a new application.mk under the Jni folder; Add App_stl: = Stlport_static to the right of the value can also be replaced by the following:
System-Uses the default minimal C + + execution library, which makes the resulting application small and memory-intensive, but some features will not support
Stlport_static-use STLport as a static library, which is highly recommended by the Android Development Network
Stlport_shared-stlport as a dynamic library, this may produce compatibility and some low version of the Android firmware, not recommended for the moment.
Gnustl_static-Using the GNU libstdc++ as a static library
By default, STLport does not support C + + exception handling and Rtti. So do not appear-fexceptions or-frtti; It is possible to use Gnustl_static to support standard C + + features, but the resulting file size will be large and the execution will be less efficient.
Supports C + + exception handling. Add Local_cppflags +=-fexceptions in Application.mk, and support Rtti in the same way, add Local_cppflags +=-frtti. Here again, the second one says use Gnustl static library, not stlport.
Force another compile STLPort, add Stlport_force_rebuild in application.mk: = True to force another compile STLPort source code, for some reasons may need to change the next STLPort library, General developers do not need to use this
2. Include the associated header file in the CPP file to use the STL, and make use of the using namespace Std;
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
How is the Android app using the STL library