We live in a world that is constantly evolving, and it’s doing so rapidly. If you don’t keep up with it and continue learning, you will get left behind.
The Software Industry is no exception. Quite the contrary actually. We, Software Engineers, might be hugely responsible for this. We’re constantly looking for ways to make things faster and more efficient. But, as a result, we must also keep up with ourselves.
I’ve spent the last six months working with Google’s Android Architecture Components (AAC) which is a collection of libraries that developers can integrate their apps with to make them more robust, testable, and maintainable. These components consist of Dagger 2, Room, LiveData, the MVVM Design Pattern, and numerous others that fall under Android Best Practices.
As with everything new, we must learn how to use it.
Although AAC is well-documented, some resources are lacking. For example, I recently refactored a Swipe-to-Refresh view so that it uses AAC, but I struggled more than I thought I would. My assumption was that I’d be able to find a rich example with a quick Google search, but I failed miserably. I scoured the net clicking on every search result, but no luck. I knew this was a red flag when I had to resort to the second page of my search results. I started wondering, “If there isn’t a clear example of something so trivial like this on StackOverflow, maybe it’s not possible to implement with AAC.”
Nonsense, there must be a way.
So, I put on my big boy pants and dove into some LiveData documentation. After about an hour, I was able to get it to work, but I was disappointed that a clear cut example didn’t exist. Especially for a feature that is so ubiquitous among mobile apps. That’s when I realized, an example of this implementation is a missing resource that is probably valuable to other people.
Thus, this blog will be my attempt to provide those missing resources.