New CrystaX NDK 10.3.2 is available, offering numerous great features and improvements; perhaps you should check it out instead of using old one.
This is a distribution of an improved Android NDK (Native Development Kit) from Google. This NDK is a fully working replacement of the Google NDK and can be used everywhere where Google's is intended to be used. The CrystaX NDK provides functionality identical to Google's NDK as well as many fixes and improvements not available in Google's. This project was initially started by Dmitry Moskalchuk (CrystaX) to just add C++ features (such as C++ exceptions, RTTI and STL) to the Google NDK, but many additional needs were discovered, and it turned out that improving the CrystaX NDK step-by-step is in fact the better way to force evolution of native Android development. Many open-source and commercial projects have used the CrystaX NDK for porting and development for Android with minimal effort.
Key features of the CrystaX NDK:
- Wide characters.
Google's NDK doesn't support wide chars properly in C or C++. With the CrystaX NDK, you get full standard compliant wide characters support. You can easily port existing code that uses wide characters/strings/streams or write new code.
- The most recent toolchains
The CrystaX NDK includes the most recent versions of GCC and Clang compilers as well as stables. This allows developers to use new language abilities (such as new C++ 11 features). All compilers are built with high- and low-level optimizations which enables generation of the most efficient code for target hardware.
- C++11 support
Since the CrystaX NDK includes the most recent versions of GCC and Clang, it supports many new C++ 11 features listed on C++0x/C++11 Support in GCC and C++98 and C++11 Support in Clang.
In addition, the CrystaX NDK offers fully working C++ 11 classes std::thread, std::mutex, std::chrono etc. These classes are not available in the Google NDK because of lack of functionality in Android Bionic libc. We have investigated this problem and fixed it, so in the CrystaX NDK you can just use them and forget about ifdefs.
- Objective-C support
The only languages the Google NDK supports are C and C++. The CrystaX NDK adds support of Objective-C in addition to C and C++. Only the core language is supported as of now; work on Cocoa-like libraries is in progress. To start using Objective-C in your project, just add source files with the extension .m (Objective-C) or .mm (Objective-C++) and specify them in LOCAL_SRC_FILES in Android.mk.
- To be continued...
If you don't see some great feature here, don't hesitate to contact us and ask for it. You can also use our issue/bug tracker to report bugs or feature requests. And, of course, contributions are welcome!
The content of the CrystaX NDK is covered by various open-source licenses. See the copyright disclaimers in each respective file for details.
Note that the CrystaX NDK release packages also contain prebuilt binaries for the compiler, linker, archiver, etc. The source codes for the toolchains are available at GitHub (you can use the build script to download it automatically).
The prebuilt GCC and companion binaries (GDB, binutils etc) are covered by either the GNU General Public License (GPL) or the GNU Lesser General Public License (LGPL). For details, see the files COPYING and COPYING.LIB under $NDK/toolchains/$tc/prebuilt/$system.
The prebuilt LLVM/Clang toolchains are covered by the LLVM "BSD" license.
Basically, licensing rules are the same as for Google's Android NDK - i.e., both commercial and non-commercial usage allowed. The only additions are regarding CrystaX parts, which are covered by a permissive BSD 2-clause license.
How to build
You can also build the distribution from sources if you don't want to use the prebuilt versions for some reason. Follow the instructions below.
Setting up the build environment:Follow the instructions from the AOSP site except the Java part. Then install the repo tool as described here. Ensure you have repo in your PATH.
WARNING!!! Building the Windows version of CrystaX NDK is only supported on a Linux machine (cross-build used). Building on a Windows host is not tested and not supported.
- Download the build script and run it:
wget -O - https://crystax.com/download/ndk-crystax-r8-build.sh | /bin/shIt will take a long time - up to several hours. When the script is finished, it will print the directory containing the package with the NDK release.
- You're done! Use this package as a replacement of Google's NDK!
Thank you for downloading CrystaX NDK!
CrystaX NDK is a fully open source project, free to use in any open-source and commercial environment. We provide it free for use and don't ask our users to pay in exchange. However, we appreciate your support, through sending us pull requests, spreading the news about CrystaX NDK over the world, or just donating:
Who we are
We're a small team of developers who want to make development for Android easier. Our goal is to create a comprehensive toolkit for native development for Android on C, C++, Objective-C, and, potentially, in other programming languages already working on modern POSIX systems (Swift, D, Haskell, Ocaml, Python, Ruby - you name it).
We've already done a lot (as you can see on our main project page), but we want to do even more. We have a long way to go, but we know how to do it and can clearly see the steps required to make it happen. You can read more about us here.
Why we need your support
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.
Having support from the community, we could pay more attention to CrystaX NDK development, without the distraction on paid contracts. This will speed up CrystaX NDK development as well as bug fixing and support.
Optionally, sponsors (those who send us $200/month or more) get in exchange a number of perks - they get priority for consulting or training needs, they can be listed on the front page of the CrystaX website and mentioned in the project README, etc. Please read here for more details about sponsoring options.
When the download is finished, please check that the downloaded file is not corrupted!
The SHA-256 hash must be .
Here is an example of how to check it using OpenSSL:
$ CHECKSUM= && \ FILE= && \ diff <(openssl sha256 $FILE) <(echo "SHA256($FILE)= $CHECKSUM") \ && echo 'OK' || echo '*** CORRUPTED!!!'