My name is Dmitry Moskalchuk and I’m the author of CrystaX NDK - Native Development Kit for Android.
I started this project in 2009, by adding full C++ support to the Google’s Android NDK (Google's first Android NDK versions did not support C++) - language core as well as the C++ standard library. The first CrystaX NDK release became popular very quickly because people really needed C++ to make their applications/libraries work on Android without having to rewrite them in Java. Google added the same level of C++ support two years after the first CrystaX NDK release. It became clear to me at the time that there were many other things in Android NDK that it would be good to fix or improve, so I reformulated the project from "Android NDK with C++ support" to an “Improved Android NDK” and continued to work on it.
I’ve now been working on the project for five years, adding more and more features to the NDK to improve native development for Android. Two years ago, Alexander Zhukov also joined this project, so now we’re working on it together. Since we started working on CrystaX NDK we have funded ourselves without any sponsorship. That has led us to make money in other ways (such as working as contractors and doing consulting jobs on other projects) and invest our earnings in the CrystaX NDK project. Because of this we have only been able to work on NDK part time, which means it is not as powerful as it could be. We switched to working full-time on CrystaX NDK over the last eight months and now we have achieved significant results, which you can read about on the NDK page.
Looking further, we plan to turn CrystaX NDK into a powerful comprehensive toolkit that allows developers to use their favourite programming languages, frameworks and libraries - i.e. making Android developer-friendly without splitting developers to first-class (Java) and others.
Native development for Android has had poor levels of support:
- Android libc is far from being called “standard.” It just doesn’t support many things required as standard – such as wide characters, locales etc. That makes porting existing code from other platforms very difficult.
- Android libc is also far from stable - many functions exposed by libc are partially implemented or buggy. There is no need to say how important it is to have a stable basis and why it is so bad when it’s buggy - weeks or even months of debugging are required as a result.
- Even if some things are fixed in new Android versions, previous Android versions don’t receive backward fixes for native components. Google only provides backward compatibility and backports for Java API.
- There are no good tools for native debugging. Even though gdb/lldb already support remote debugging, in practice modern debugging of native binaries on Android is almost impossible.
- Almost everything important for applications’ functionality is only available through Java API. This means the whole UI, web, services, network management API, In-App Purchasing, etc.
- There is no support for any native programming languages, with the exception of C and C++. It has become even more important now, when Android has spread across the world, that it runs on really good hardware (not only phones; nowadays this means tablets, TVs, car navigators etc.).
We’ve already fixed many such problems in CrystaX NDK and we’re going to fix the rest. We’re providing additional layers, which transparently replace libc functionality for applications and provide better standard conformance, turning Android into something that conforms much more to standards than it has in the past. We have also taken care to provide backward compatibility and backports, so that all fixes become available on all supported Android versions. That makes porting of existing code (that already works on other POSIX platforms) much easier. This is the first step that is required to move further - i.e. to implement a comprehensive native API for the whole system, including the UI and other things.
We have also started regular regression testing of the Boost C++ libraries on Android - so Boost can become a first-class citizen on Android. There is no need to explain what Boost is; modern C++ development is almost impossible without Boost - either through the direct use of Boost libraries or having been inspired by Boost techniques. Even the ISO C++ Standard is based on Boost.
However, up until now Boost has not been supported on Android for many reasons. Firstly, many things simply did not work because of numerous problems, such as Android libc bugs or even a lack of functionality. Secondly, no regular regression testing was done and it made no sense to do it until basic problems were fixed. In CrystaX NDK, we have made Android conform much more closely to standards (ISO C, ISO C++, POSIX etc.) so that Boost (as well as tons of other projects) will start to work on Android without needing to be rewritten. We strongly aim to continue to support Boost on Android, fixing NDK if needed, or fixing Boost itself - so Boost becomes a first-class citizen on Android too.
Now, we want to move further and add more features because we have a solid basis for further development and it will be much easier to add new features. Ideally, we’d like to create a comprehensive toolkit for native development in Android, allowing developers to create any kind of Android applications (UIs as well as services, broadcast receivers etc.) without requiring them to become involved in the Java language and toolkits.
We also want to allow people to easily port iOS applications to Android, providing an Objective-C compiler as well as Cocoa-compatible frameworks. Ideally, people will be able to just build iOS applications for Android with the help of CrystaX NDK, without touching the source code of their applications at all.
There is long way to go, but we know how to do it and can clearly see the steps required to make it happen. To do it, we need help from people interested in the evolution of native Android development.
Below are some of the features we’d like to add to CrystaX NDK.
- A repository of prebuilt libraries and headers for development in Android. A kind of ‘apt-get’ in Debian or ‘brew’ in OS X. We already have a client tool for that and have called it “crew.” To do any serious native development, developers need to use well-known and well-tested open source libraries - openssl, libraw, freetype, ffmpeg/libav, expat/libxml2, libjpeg, libpng, etc. At the current moment every Android developer is forced to build such libraries on his own, fighting with all its peculiarities and bugs. We’d like to simplify that as much as possible - i.e. the developer would just type “crew install libpng” or “crew install ffmpeg” and get ready-to-use binaries and headers in the NDK folder in two seconds.
- Provide Objective-C v2 support. Right now, CrystaX NDK supports Objective-C core. However, there are significant limitations that prevent real usage of the feature. First off, we only support the Objective-C v1 runtime. There is no support for the Objective-C v2 runtime yet. Second, we do not have ready-to-use Cocoa-compatible frameworks yet. As soon as we implement this, developers will be able to port Objective-C code easily from iOS/OS X to Android.
- Support more programming languages. Right now we support C, C++ and limited Objective-C. However, there are many other languages in the world and we’d like to add their support to CrystaX NDK. Think about support of D, Go, Fortran, Lisp, Erlang – wouldn’t that be cool? And the good news is that it has already become much easier with CrystaX NDK because of our core feature - standards compatibility.
- A native API. Right now, the only comprehensive API for Android is Java API. To use it in other languages, developers are forced to write JNI wrappers or use libraries like Qt, which provide a unified API for all platforms but, unfortunately, still don’t provide a full set of Android APIs. We’d like to fix this situation, providing native (C and C++) APIs for all Android API calls, allowing them to use APIs from any native language as easily as possible.
We have more cool features to implement, but these are the most interesting from our point of view. We’re also open to discussion and would be happy to hear new ideas and will even implement them if many people want them. Use our issue tracker or contact us directly with your ideas.
We have plans for the further evolution of CrystaX NDK. We want to make it a comprehensive toolkit for native Android development, providing a solid basis for any POSIX-conforming software to be able run on Android without significant rewriting. To do that, we're asking for help from the community.
We've started a fundraising campaign on BountySource to continue the development of CrystaX NDK and keep it available free to all Android developers. We're asking everyone interested in the further evolution of native development for Android to help us. We would very much appreciate any kind of help - whether it is funding, contributions to the project by sending us patches, or helping to spread the news all over the world.