Your SlideShare is downloading. ×
Ronan Schwarz; Context is Magic
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ronan Schwarz; Context is Magic

1,166

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,166
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Context is Magic (short version)http://generalzoi.deviantart.com/art/Pony-Creator-Full-Version-254295904
  • 2. What it is _Definition of Context (Merriam-Webster) _1: the parts of a discourse that surround a word or passage and can throw light on its meaning _2: the interrelated conditions in which something exists or occurshttp://www.merriam-webster.com/dictionary/context
  • 3. http://www.merriam-webster.com/dictionary/context
  • 4. Defect Unicornshttp://www.merriam-webster.com/dictionary/context
  • 5. What it does _ holds references to: – ActivityThread – ContentResolver – PackageManager _ caches Theme and Resources _ has a HashMap of SharedPreferences _ can comunicate with the ActivityManager _ keeps track of Permissions
  • 6. There is no App
  • 7. Context + Code
  • 8. Explore _ two types of objects: derived from context or using context _ most classes derive ContextWrapper – just a delegate (service, application,..) _ nearer to the front: ContextThemeWrapper – delegate with theme (activity,..) _ getBaseContext() returns the parent
  • 9. The Tree
  • 10. Exchange _ using the wrong context can result in leaks – context leaks are nasty to debug – using Activity as context is mostly wrong _ use application context for non-UI _ construct a themed context for UI if needed _ understand where context changes take place
  • 11. Exploit _ contexts are bound to APKs _ intents can imply context changes – gain additional permissions – content might not be available _ context lifecycle is slow – uses lazy-initialization – make sure lifecycle matches _
  • 12. TL;DL _ context matters _ choose carefully _ dont leak it _ dont get surprised, be surprising
  • 13. KontaktIhr Ansprechpartner:Ronan zero Schwarz+49 173 240 28 45ronan.schwarz@sinnerschrader-mobile.com
  • 14. TL;DR _

×