In Android programming, what exactly is a Context
class and what is it used for?
I read about it on the developer site, but I am unable to understand it
An Android Context is an Interface (in the general sense, not in the Java sense; in Java, Context
is actually an abstract class!) that allows access to application specific resources and class and information about application environment.
If your android app was a web app, your context would be something similar to ServletContext
(I am not making an exact comparison here).
Your activities and services also extend Context
, so they inherit all those methods to access the environment information in which the app is running.