This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc. Context used in android application development everywhere and wrong use of it leads to memory leaks in the application.
Application Context Vs Activity Context
They are both the instance of Context class but the application context tied to the lifecycle of application and activity context tied to the lifecycle of activity.
When to use application context in the application starting Service, send a broadcast, loading a resource value. In most cases, use the Context directly available to you from the enclosing component you’re working within.