If you’re developing an Android app, you’re going to have a special guest in your codebase: the Application class. As your app grows, it’s very likely that more libraries require some kind of initialization in the Application class with the purpose of preparing its usage throughout the app, making it difficult to maintain and scale.
In this post we’ll dive into how to use them in your apps. VectorDrawable was introduced in Lollipop (API 21) and is also available in AndroidX (as VectorDrawableCompat) bringing support all the way back to API 14 (over 99% of devices). This post will outline advice for actually using VectorDrawables in your apps.
What is the first thing we need to do when we import a library ? Override an Application class to initialize it with a context 😞 But why ? and why some libs like Firebase 🔥don’t need to be initialized ? lets take a look 🧐
Yesterday we discussed the foundations of Dagger 2 for Android. That article outlined the importance of the @Inject annotation and eluded to how this dependency injection framework would hook into those annotations. The purpose of this article is to explain the why and how of the @Module annotation in Dagger.
Android is a mobile operating system designed to work with constrained memory and battery. For this reason, a typical Android application can have its process killed by the system to recover memory. The process being killed is chosen based on a ranking system of how important that process is to the user at the time. Here, in descending order, is the ranking of each class of process. The higher the rank, the less likely that process is to be killed.