Is it possible to port a C++ application which uses the STL extensively to Android? I understand that currently the NDK does not support this, but is there any effort (open source or otherwise) underway to achieve this?
If not is there a way to cross compile libstdc++ for Android?
UPDATE: Ndk Revision 5 promises a default STL implementation based on STLport. http://android-developers.blogspot.com/2011/01/gingerbread-ndk-awesomeness.html Read this official NDK blog post, http://developer.android.com/sdk/ndk/index.html>and the revision notes.
Android is based on Linux Kernel so it's definitely possible to compile & run C/C++ programs on Android. C is quite cross-platform , so a C Program written in Windows can Run on Linux ( and android ) and vice versa.
C++ can be used for Android App Development using the Android Native Development Kit(NDK). However, an app cannot be created totally using C++ and the NDK is used to implement parts of the app in C++ native code. This helps in using C++ code libraries for the app as required.
yes you can. theoretically! or you may even write the assembly for your apk directly. Save this answer.
You may want to start with Dmitry Moskalchuk's modified version of the NDK (includes support for exceptions, RTTI, and the standard c++ library). Keep in mind that if you go down this path your application's size will be larger as you will be statically linking a c++ library into it. Also, this thread from the andriod-ndk group may give better direction on how to incorporate the STL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With