Maintaining an app has some similarities with keeping a website up and running. One day everything is fine. The next day, an update goes out that leaves thousands of people unable to do anything. Now they're ranting on Twitter, leaving poor reviews on Google Play, and giving you a massive dose of negativity and rage to encounter when you sit down at your computer.
Remember back in December (and January) when Packt Publishing gave away a couple free ebooks focused on Android development? The one-a-day promotion has been going strong since, but the books haven't exactly been targeted at the OS on our phones. But great news: this whole week is dedicated to mobile development!
The current freebie is all about showing love to both sides of the phone war – it's Xamarin Cross-platform Application Development. But you better hurry over and claim it, this particular book will expire in just over 5 hours. (Sorry, we saw this one a little late).
While the free book is enough reason to drop by, there's something more interesting afoot in this promotion.
Yesterday you read about (and maybe understood) the new Java 8 language features coming with the Android N Developer Preview. One of the prerequisites of using these improvements is the latest version of Android Studio. The IDE was briefly mentioned in that article, but we thought it deserved a little more attention for both the improvements and some of the caveats to updating right now.
The Android Studio 2.1 Preview 1 is based on the current 2.0 version in the beta channel. The changelog is basically a roadmap to supporting the new features promised with Android N: support for Java 8, improved support for the Jack compiler, and an updated New Project wizard to generate projects targeting the Android N Preview.
Developers have plenty of great new APIs and features coming with Android N, but perhaps the best thing to look forward to is at the language level itself. Starting with the preview SDK due out today, some of the language features of Java 8 will be supported by the Jack compiler. This will bring things like support for lambdas, default and static methods, streams, and functional interfaces. Google is also declaring that the Jack compiler will also be able to remain more up-to-date with Java language features in the future.
One of the top requests from developers over the last few years has been for a more rapid uptake of new language features for Java, many of which would allow for more efficient use of development time and ultimately easier to read code.
A fresh version of the Android Support Library is now available to developers. This may be one of the biggest updates in quite a while, as some of the changes demand a few significant internal changes. On the plus side, there aren't very many changes that should break existing code, and most of the new features will make it worth the trouble. Here's a quick introduction to some of the new changes.
Vector Drawables and Animated Vector Drawables
Full vector support was first introduced in Android 5.0 Lollipop, allowing developers to distribute apks with easily resizable vector drawings in place of multiple images at various sizes.
When a manufacturer open sources the code that makes their device work, it's an occasion worth noting. This is one of the strengths of Android, the availability of files that enable developers and tinkerers to create software that can replace the firmware that our devices ship with. It's one of Android's differentiating factors compared to iOS and Windows Phone.
Kotlin has been emerging as a programming language to keep a close eye on. It started as an internal project at JetBrains back in 2011 and was released early the next year. Taking inspiration from both classic C-based languages and a number of modern alternatives like Scala, Kotlin is branded as a "pragmatic" language and modeled to encourage smarter coding and easier readability. JetBrains has been tiptoeing up to an official v1.0 release for a few months, and today, it's finally here.
While it's still a fledgling language, Kotlin has earned some enthusiastic supporters among the Android development community, even a few Googlers have discussed using it in projects.
The Android Studio team has been kicking out preview builds at a fevered pace since the first 2.0 preview hit the scene near the end of November, and it's finally paying off as the first real Beta is now rolling out. (The first beta has an issue, so this is actually labeled Beta 2). The jump from v1.5 to v2.0 is enough to suggest that this could be the most ambitious update to the IDE since it was launched, but the feature list confirms it. We've already covered some of the biggest features: instant run, GPU profiling, and a massively faster and more functional emulator.
If you're an avid gamer on Android, get ready to see quite a bit fewer of those pesky Google+ sign-in prompts. Google is rearranging things a bit in the Games API to cut back on permission dialogs and authorization requests so users have an easier time getting straight into the action. The changes should also allow game developers to take advantage of Google's Games API and services like cloud sync without asking users to trust them with account details and potentially sensitive information.
With the new model, users will only be asked to sign in once per account—just to set it up—and every subsequent new game that runs can sign in automatically.
Some of the most interesting additions to Android often come from unofficial sources. Maligned though they may be, Google has incorporated many features previously only found in manufacturer skins into AOSP, and custom ROM developers add new features more or less as they feel like it, some of which are quite useful. For example, the CyanogenMod development team is working on a new integrated system for handling "locked" apps, applications that can't be accessed by the user without a password or other validation mechanism.