When you have an idea for an app, or even just when you need a playground to tinker with a hack, one path of resistance you need to overcome is the time it takes to set up a project. For most Android apps, we need to set up our Gradle build file with all the required dependencies such as Testing suites, Android Support libraries, Play Services, and legacy-friendly UI widgets.
Prior to this my workaround was to keep a template of a project in my repo, but even this requires maintenance to ensure the libraries were up-to-date and not causing build issues due to incongruent versions.
This year at Google I/O, the tools team announced Jetpack; a set of components, tools and guidance for easily integrating the required dependencies that are not part of the underlying platform into the project. The required components can now be adopted into the build independently as they are required, meaning less code and faster build times.
The amount of architectural patterns can be daunting to a developer when it comes to deciding on how they should structure their app. One of those tasks being to distinguish similarly acronymed MVP (Model-View-Presenter), MVC (Model-View-Controller), MVVM (Model-View-ViewModel), etc.
This detailed write-up with helpful code samples outlines the difference between the 3 main architecture types from an Android perspective.
What I like about MVI is that you don’t have to alter your project to implement it - the pattern can be localised to a secluded section, whereby your app can be scaffolded by MVP pattern but smaller local tasks can use MVI, such as fetching server data while reflecting the current state in the UI.
This article (and subsequent follow-ons) outlines in more detail the benefits and how to move towards the pattern.
The paradigm of performing long-running background processes in Android has gone through many transformations; SyncAdapter, Services/IntentServices, JobSchedulers, Evernote android-job, priority-job-queue, etc.
I/O 2018 had another significant announcement: WorkManager; a framework that abstracts away the burden of setting up these tasks. This verbose article (with its underlying Star Wars theme to alleviate any boredom) starts with the basics of Android processing memory management and leads into the reasons why we need WorkManager, and why “The service as we know it today – has deprecated.”
Android’s new framework Room handles database operation with ease, but under the hood it’s still working with SQLite package. It also still gives the developer to access the low-level database API behind the abstraction, so it’s still worth knowing how it works and what we can do maximise performance when dealing with large data. This article shows detailed benchmark tests for inserting large datasets.