7
What Exactly is “Context” in Android ? Bible

What is context

Embed Size (px)

Citation preview

Page 1: What is context

What Exactly is “Context” in

Android ?Bible

Page 2: What is context

Reference

• http://stackoverflow.com/questions/3572463/what-is-context-in-android

Page 3: What is context

Definition of Context

• Context represents environment data

• It provides access to things such as databases

Page 4: What is context

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

Page 5: What is context

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

Page 6: What is context

Things that involve context

• Loading a resource

• Launching a new activity

• Creating views

• Obtaining system service

Page 7: What is context

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