Upload
bible-tang
View
200
Download
0
Embed Size (px)
Citation preview
What Exactly is “Context” in
Android ?Bible
Reference
• http://stackoverflow.com/questions/3572463/what-is-context-in-android
Definition of Context
• Context represents environment data
• It provides access to things such as databases
Simpler terms• CEO of a start-up software company
• a lead architect present in the company
• CEO Hires a new Developer
• It is the Architect who tells the responsibility of the new hired person
Simpler terms• It's similar to a when you visit a hotel, you want
breakfast, lunch & dinner in suitable timings right ?
• There are many other things you like during the time of stay. How you get these things?
• You ask the room-service person to bring the things for you
• Here room-service person is the context considering you are the single activity and the hotel to be your app, finally the breakfast, lunch & dinner to be the resources
Things that involve context
• Loading a resource
• Launching a new activity
• Creating views
• Obtaining system service
Context is the base class for Activity, Service, Application ....
etc• Another way to describe is, consider context as
remote of a TV & channel's in the television are resources, services, using intents etc - - - Here remote acts as an access to get access to all the different resources into foreground.
• So, Remote has access to channels such as resources, services, using intents etc ….
• Likewise ..... Whoever has access to remote naturally has access to all the things such as resources, services, using intents etc