The State of Android Development in 2017

In September it’ll be nine years since the Android Operating System first appeared. Now at version 7 (Nougat), and the third developer preview for Android “O” (no name yet!) appeared at the start of June. The release should appear around August or September.

The standard way of developing for Android is Java and that’s recently upped to version 8 but to use all the great features (Lambdas, new closure syntax, method-references, default methods on interfaces etc.) that you need an Android running Nougat (version 7.0, or more specifically level 24).
It’s a bit of a flaw when comparing Android with iOS is that Android updates depend upon the phone’s service provider while Apple provides all iOS. Google finally appear to be addressing that with project treble which will apply with the release of Android O.
For version ‘O’, apps will need to support version 26.
However Java is not the only way to develop for Android, there have been several cross-platform solutions involving JavaScript (PhoneGap, Sencha,Titanium), Lua (Corona), C# (Xamarin) plus Android Studio now has support for C/C++ with the NDK (Native Development kit).

Recently though there have been some other developments. The first one is Kotlin which in May 2017 received official support as an Android development language.

Kotlin

Kotlin is an open source programming language from JetBrains, the creator of the Intellij Idea IDE that underpins Android Studio, Google’s official development tools for Android. It’s a replacement for Java but is 100% interoperable with Java and will compile Java. You can call Java code from Kotlin or Kotlin code from Java. This lessens the risk when converting your app from Java to Kotlin. You can do it in stages rather than all at once.
Why would you switch to Kotlin? Here’s a few reasons.
Your code is shorter, approximately 40% fewer lines of code according to the Kotlin website FAQ. Kotlin is compatible with JDK 6 (the current Java Development Kit version is 8). Kotlin tooling is fully supported in Android Studio and the Kotlin runtime adds less than 100Kb to the size of the .apk file.

Also if you develop for iOS as well, Kotlin and Swift have a lot of syntax in common. There’s even a web page highlighting their similarities.

If you are unsure about Kotlin for Android, read Basecamp’s experiences with a 100% Kotlin app. Also, Google provides a few Kotlin examples on their Android website.

The current version of Android Studio is 2.3, it came out in March 2017 and if you want Kotlin you have to download and configure the plugin. Version 3.0 will have ‘Out of the box’ support built in for Kotlin.

Android Studio

This gets better with each version and has lots of JetBrains slickness. It’s approaching Visual Studio for usability. One slight pain, and it’s not Android Studio’s fault is that debugging doesn’t work on Windows if Hyper-V is enabled or at least debugging with an emulator so it might be that Intel HAXM is to blame. That’s an essential speedup for the emulator.

Android Things

This was announced a couple of years back so is still fairly new, I hadn’t seen that much mention of it. Originally called Project Brillo, Android things is about programming the Internet of Things using low cost hardware and Android software.

Google have partnered with SoC companies to build Android certified development boards with System on Modules (SoM). There’s half a dozen systems of which the best known is probably Raspberry PI 3. There are system image downloads (about 250 MB each) for all six systems.

Firebase

Acquired by Google in 2014, Firebase is a mobile platform that provides a series of web services and can be used from version 26 (Android O). Google Analytics for Firebase is the core functionality and is also available for iOS, Unity and C++.

Other services include Cloud Messaging which can push messages to iOS apps as well as Android, Unity, C++ and Web (via JavaScript), Cloud functions, Authentication, Real-time Database, Storage and Hosting.

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.

Conclusion

It’s an interesting time to be an Android Developer with things like Firebase and Kotlin. Bear in mind that it will take time for newer versions of Android to be deployed. The AppBrain website has stats on version usage. As of June 24th, Android Nougat (7.0-7.1.1) had only reached 10% with the bulk of phones (60% split evenly between Android 5.0,5.1 (Lollipop) and Android 6.0 (Marshmallow)

Post a Comment

Your email address will not be published.