Today I would like to present to you my predictions for 2020 in Android development. One of your top priorities if you are a mobile dev is staying up to date and remaining inspired by new things, even if it means challenging your beliefs.
App developers are constantly working on new methods to simplify and shorten the development process on one hand and build the best designs and user experience on the other. Each year we can see the continuing emergence of new, cutting-edge techniques and tools in mobile apps development. Here I present the trends that will give you a better insight into what should be on top in year 2020.
If you have not used Kotlin Coroutines yet, it is high time to start using them. They are one of the best ways to make asynchronous tasks. Since Google announced Kotlin First, it has become natural to use Coroutines. They are not just a simple tool for creating sync tasks, they also have advanced features like:
There are also useful extensions for ViewModel and LiveData:
Coroutines vs RxJava2
It is not an article about differences so I do not want to go into deep details. The main difference is that RxJava2 is a really powerful tool not only for async tasks. If you ask me what solution you should use, the answer is simple, it depends on your requirements, so I suggest you read more about these tools and make a deliberate decision.
Since Android 10, Google officially has supported a dark theme. It means we can rely on system settings, and adjust our app to system theme. Multiple themes support have already been added to many apps like Instagram, Chrome or just Medium. You can use also new Material Components Styles in version 1.1.0 to support the dark theme functionality in Android Q. Unfortunately this is still in beta. More information here.
Google has put a really big effort to improve security on Android devices for the last years. Not every app needs really advanced solutions, but what I would like to highlight is the new security library from Google.
Jetpack Security is a way to store data more securely in Shared Preferences. The most important thing is that the library uses Android Keystore System.
It has been announced lately and is in alpha version. Check it out here.
If you want to learn more about security, just check my article.
Google introduced Navigation Component at Google IO in 2018 and it took almost a year to prepare a stable version, which was released in March 2019.
It is a completely new approach for designing a navigation graph for Android apps. This solution is similar to that from iOS which is called Story Boards. We implement a navigation graph in Navigation Editor or just editing XML files. Navigation Component supports things like fragment transactions, deep links, SafeArgs and even view model scopes.
More about Navigation Component here.
View Pager and Recycler View. This sounds great, but it was not possible before. Now with View Pager 2, it is possible.
Moreover, since the 20 of November 2019, View Pager 2, has been released in a stable version.
View Pager 2 brings us a lot of improvements:
- works with RecyclerView
- support for vertical orientation
- new PageChangeCallback — no need to override all 3 methods
- added different Page Transformers
If you want to find out more about View Pager 2, check this article.
This is a library which helps us to save instance state. Why is it even needed if ViewModel can survive configuration changes? A configuration change is not the only case. Android Developers should be aware of system-initiated process death as well. For this, we should save the state serialized in disk space and now we have this built-in ViewModel.
The stable version has been available since September 2019, but there is also extension library ViewModel-SavedState in RC-03 version.
Last but not least, Jetpack Compose. To be honest, I have really high hopes for this. It is a totally new way of creating views in Android. We can even say finally we have something like that. This solution is a reactive way to create UI and it is entirely written in Kotlin!
If you want to try Jetpack Compose, check out this tutorial.
Unfortunately, Jetpack Compose is not even in the alpha version, it is in Developer Preview.
In 2019 there were a few news in the Android world. Obviously the biggest is Jetpack Compose, but it can take a long time to make it stable. It may not even happen in 2020, but for sure it is worth learning and it is a future of building views in Android.
What do you think about my predictions? Would you add something to my list? Write it in comments :)
If you find out something useful from my articles, give me 👏🏼 and follow me.