BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Android NDK r21 Is the First NDK Release with Long Term Support

Android NDK r21 Is the First NDK Release with Long Term Support

The latest NDK for Android, version r21, now available in beta, brings a number of significant changes, including Fortify being enabled by default, and newer versions of GNU Make and GDB. Additionally, starting with r21 Google will manage a new release process with a yearly Long Term Support (LTS) guarantee to provide users more stability.

Of the new features that went into Android NDK r21, the most notable is perhaps Fortify being enabled by default. Fortify is a set of extensions to the C standard library aimed to catch programming errors as soon as possible. Specifically, Fortify makes sure programmers correctly use standard functions such as memset, sprintf, open, strcpy, and others. Fortify will either flag an error it finds or, if it suspects a bug might be present in a piece of code, will instrument it to detect the bug at runtime and abort the program. For example, Fortify is able to flag the following code, which would otherwise compile just fine:

    const char src[] = "this string is too long";
    char dst[10];
    strcpy(dst, src);

    test.cpp:10:18: error: 'strcpy' called with string bigger than buffer
      strcpy(dst, src);

Another significant change in Android NDK r21 is Neon being enabled by default. Neon is code-name for ARM advanced SIMD, which provides improved performance on compatible ARMv7 devices. Not all ARMv7 Android phones are compatible with Neon, so the NDK provides a mechanism to disable it in case compatibility with older devices is a must.

LTS is of interest to users prioritising stability over new features. According to Google's new release process, one NDK release a year will be annointed as LTS after undergoing a longer beta-test period. LTS releases will only receive bug-fixes and back-ports. Between two successive LTS-releases, Google will continue issuing "rolling" releases in a way similar to the current release process. While LTS releases will be issued yearly, rolling releases will have a quarterly cadence and will include the latest changes and most recent versions of the toolchain.

Android NDK r21 also brings new minimum system requirements, removing support for 32-bit Windows and requiring glibc 2.17 or newer on Linux.

You can get the latest Android NDK r21 from Google NDK download page.

Rate this Article

Adoption
Style

BT