However, it took Android a while to get to where it is now. The first release of Android took place in 2008, and we’re now at the 9th version the system, codenamed ‘Pie’.
Android is constantly evolving, and so are the trends surrounding the development of software for Android-driven devices. In this article, we will showcase the top three Android development trends in 2018: Kotlin, Android Jetpack, and Machine Learning.
The first major trend we will talk about is Kotlin. The project started in 2011, and it was released in 2016, by JetBrains, a prominent software development company. The idea behind Kotlin was to create a language that would include the features developers were missing in other JVM languages.
Kotlin also received a major boost from Google themselves, who announced the official support for the language, making it an important milestone in the Android dev space.
As for the benefits of using the language, our developers have mentioned a number of them. One is that Kotlin boasts nullability-safe extension functions, as well as higher-order functions, which, as they say, ‘make Android development easier and more fun.’ Another advantage of Kotlin is the fact that it’s expressive. This means that the code you write is less prone to errors, which can save time and money on QA and debugging. But wait, there’s more! Kotlin also cuts down on boilerplate code, which basically means less mindless work, less code to maintain, and more bang for your developer buck. This is thanks to the data classes and list operators employed by Kotlin. Moreover, the language is extremely easy to pick up for Java devs – one of our team members says that he started feeling confident working with it after just two weeks.
Android KTX can be best summarized in the words of its creators, who wrote the following: The goal of Android KTX is to make Android development with Kotlin more concise, pleasant, and idiomatic by leveraging the features of the language such as extension functions/properties, lambdas, named parameters, and parameter defaults.
In other words, KTX is basically a set of extensions that make Android development a lot easier. It reduces the amount of boilerplate code even further, thanks to such improvements as being able to execute actions on objects directly, rather than on static helper methods. While the differences between the KTX-enhanced and ordinary Kotlin code may seem subtle to outsiders, our developers swear by it despite its limitations.
2. Android Jetpack
Android Jetpack, a hot topic in Android dev, is, as the name implies, a collection of software components that make Android development faster – much like a jetpack would. From the early days of Android, Google always did its best to help developers deal with the ecosystem’s obstacles – one of the major improvements was supporting backward compatibility. To implement it, Google decided to create support libraries. Another issue was managing apps when their data changes – so Google created Architecture components. Now, these helpful components have been put into a single package, Android Jetpack. It’s made up of four parts: Foundation, Architecture, Behaviour, and UI. We’ll go over our favourite components you can find inside of these groups in the following subsections.
Navigation between screens is an inseparable part of Android development, and it can get really difficult in more complex applications. This is why it’s a good practice to separate the process of launching a new screen as a standalone module. This is where the Navigation component, which simplifies in-app navigation, comes in. It supports activities and fragments by default, so no more dealing with `startActivity` or fragments transitions. It also represents all in-app destinations as a graph, making it easy to see the user’s path. In addition, the navigation between app screens can be configured using XML attributes or programmatically. Another benefit of Navigation is that it includes all the best practices recommended by Google, including deep-linking to destinations, which is very useful in notification handling.
Throughout its history, Android has seen the rise and fall of many different approaches to the structure and architecture of apps. These include MVC, MVP, MVI, and MVVM. All of them have their pros and cons, and they can be used in different configurations. The main aim of all architectures is to separate the application’s business logic from the UI, increase testability, and simplify maintenance. Over all these years, developers have been flooded with the number of different options, and Google did little to make things easier. It all changed in 2017, when Google announced Architecture Components, their vision of app architecture.
Architecture Components consist of two main concepts: LiveData and ViewModel. LiveData notifies the view about any changes in the underlying data source, while ViewModel holds all LiveData objects and doesn’t break up after device orientation change (which is a frequent problem on Android). A great thing about Architecture Components is its awareness of the activity lifecycle. it isn’t necessary to override the `onResume` or `onPause` methods to handle subscriptions – everything works behind the scenes. Overall, Architecture Components are definitely worth trying out in your next app.
One of the greatest things about Android is that applications can just open another app instead of re-implementing its features. One example is file pickers. If it's necessary to pick a file from the device, the best approach is to handle this process using the system app, ensuring a familiar experience. Another great thing is that it is possible to open another app with the selected content. For example, you can open Spotify with the selected song knowing its title. These concepts pushed Google to go deeper and create the option to place the functionalities of your app in the Search App and, in the future, in Google Assistant. Slices allow you to build custom layouts inside the Search App, which is great because the user can access your application right from the built-in Google-provided application. In the future, when slice support is added to Google Assistant, it will also be possible to control apps by voice.
3. Machine Learning
Machine learning is one of the hottest topics in the tech world. Due to the release of Firebase MLKit, it’s also becoming very hot in Android dev. MLKit contains three main technologies, which can be used separately: Google Cloud Vision API, TensorFlow Lite, and the Neural Network API. MLKit wraps them in one neat package and serves as a single SDK. Machine learning is a difficult technology to work with. It requires expert knowledge, resources, and experience. However, MLKit makes it possible for mobile developers to implement ML features with relative ease. Read on to learn about the top applications of MLKit.
Text recognition is a well-polished technology that’s been with us for a while. Now it’s become available to mobile developers for free (the free cloud version is limited to 100 requests). Another limitation is that it is only possible to recognise languages using the Latin alphabet on mobile devices. As for its upsides, on-device recognition returns the structure of the photographed document – essentially the full text, which consists of blocks, paragraphs, words, and symbols. It also gives you the option to locate where exactly in the provided image a given word or paragraph is placed.
This cool feature means that MLKit is able to recognise some of the world’s best-known landmarks, such as the Eiffel Tower or the Big Ben. It works on cloud only and returns its results (name of landmark, geographical coordinates, and confidence) through the SDK.
MLKit’s face recognition can work in several modes. In one mode, it can detect if an image contains a face and return its boundaries. In another, it is capable of detecting a face’s distinctive features, such as the eyes, nose, or mouth. It can also verify if the user’s face occupies a sufficient percentage of a picture (for photo verification purposes), as well as detect whether the user’s eyes are open or whether the user is smiling.
At first glance, Barcode Scanning seems to be nothing special – we’ve had barcode scanning technology for ages. This might seem true, but, in fact, very few libraries offer support for all the different barcode formats out there. This is where MLKit comes in, supporting 13 different formats. It is also able not only to handle custom data, but also some predefined events, such as sending text messages, detecting Wi-Fi connections, or adding calendar events.
MLKit’s image labelling component works both on-device and in the cloud. The on-device version provides access to around 400 labels based on the most popular concepts found in photos. The cloud version has more than 10,000 labels, but is limited to 1,000 requests per month. All labels are grouped into categories – one example is the Organizations category, which is further broken up into Government, College, Club, and so on. Image labelling has a multitude of uses – for example, suggesting tags to the user when they upload a photo somewhere. Another idea is to employ it to group photos by topic in a gallery.
The top three development trends for Android in 2018 are Kotlin, Android Jetpack, and Machine Learning. The first is a developer-friendly language that is fully interoperable with Java; the second is a set of ready-made components for your Android app; and the third is a bundle of powerful ML-based components provided in MLKit, a part of Google’s Firebase.
If one conclusion can be made here, it is that Android development is becoming easier and growing more powerful at the same time – more can be achieved with this technology than ever before. Are you thinking of building your own Android application? Do you have some suggestions about mobile dev trends in 2018? Get in touch – we’re always happy to talk!