Google’s Android operating system is now nine years old. Its next iteration, codenamed “O,” will certainly appear before the end of the year. (In keeping with Google’s longtime naming tradition, the “O” will likely become a dessert of some sort—possibly “Oreo.”)
If you’re a developer, there are lots of reasons to consider Android as a platform for your software-building endeavors. Because Google opted to give away the OS to any hardware manufacturer, there are over a billion active Android devices worldwide—a substantial install base for your next app.
However, the freedom that Google gave hardware manufacturers also came with a singular drawback: fragmentation. Or to put it another way, thousands of wildly different form factors run all sorts of Android versions and variations, making it problematic to build an app that will successfully run on everything out there.
Google’s solution for fragmentation is Project Treble, available with Android “O.” In simplest terms, Treble will attempt to alter Android’s low-level system architecture. “The core concept is to separate the vendor implementation — the device-specific, lower-level software written in large part by the silicon manufacturers — from the Android OS Framework,” read Google’s blog posting on the matter. “With a stable vendor interface providing access to the hardware-specific parts of Android, device makers can choose to deliver a new Android release to consumers by just updating the Android OS framework.”
In theory, by removing the need for silicon manufacturers to exert additional effort, it should become easier for manufacturers and vendors to update devices to the latest and greatest version of Android, easing at least some of the functionality and security concerns that stem from fragmentation.
Java (currently on version 8) has long been the standard way of developing for Android. Android does not support all Java 8 features, although a handful—such as Lambda expressions and type annotations—are available when targeting Android 7.0 (API level 24).
That brings us to Kotlin, which earlier this year received official support as an Android development language.
Kotlin is an open-source programming language from JetBrains, the creator of the Intellij Idea IDE that underpins Android Studio, Google’s official development toolkit for Android. It is 100 percent interoperable with Java; you can call Java code from Kotlin or Kotlin code from Java, which lessens the risk when converting your app from Java to Kotlin.
If you’re considering whether to build an app with Android, should you use Kotlin? Here are a few reasons why it’s potentially a good idea.
First, your code is shorter—approximately 40 percent fewer lines, according to the Kotlin website FAQ.
In addition, Kotlin is compatible with JDK 6 (the current Java Development Kit version is 8), and the tooling is fully supported in Android Studio. Kotlin runtime adds less than 100Kb to the size of the .apk file.
If you’re still unsure about Kotlin for Android, read Basecamp’s experiences with an app wholly built in the language.
Android Studio improves with each successive version; it now features lots of JetBrains slickness. As a developer, I have just one complaint (and it’s not Studio’s fault): debugging doesn’t work on Windows if Hyper-V is enabled.
Originally called Project Brillo, Android Things is about programming for the Internet of Things (IoT) using low-cost hardware and Android software. Google has partnered with SoC companies to build Android-certified development boards with System on Modules (SoM). There are half a dozen systems available; the best-known is probably Raspberry PI 3.
You have to pay for Firebase services once your application’s resource use goes above a certain limit, but the free tier gives you more than enough to try it out.
It’s an interesting time to be an Android Developer, thanks to tools such as Firebase and Kotlin. If you haven’t worked with Android, now’s a great time to give it a try.