Hello World from Android ARM64

In the past I showed how to get the Crystal compiler running on Termux, by adding C runtime bindings for aarch64-linux-android24. Taking this a step further, I have managed to put together some bindings for the Android NDK and build a native app in pure Crystal:

crystal

This is partially inspired by ysbaddaden/android.cr, but use newer Android toolchains for the build process, and targets arm64-v8a instead of armeabi. It also uses icy-arctic-fox/opengl.cr for the OpenGL ES 3.0 bindings.

This is still a proof of concept, neither the compiler nor the standard library is fully prepared for this kind of usage. A main goal here is to give an idea of how to proceed with eventually having official Android support in Crystal; in particular, Android apps present one valid use case of incorporating the Crystal runtime into a shared library.

23 Likes

nice work!

Holy cow Batman! Incredible work.

1 Like