OpenIntents     www.OpenIntents.org                          ANDROID                       FUNDAMENTALS                   ...
OpenIntents                OpenIntents       www.OpenIntents.org● Founded in 2009● Open Source based Company● Two times wi...
OpenIntentswww.OpenIntents.org                             Topics                      ●   Activity Lifecycle             ...
OpenIntentswww.OpenIntents.org   Who youre gonna call ?
OpenIntentswww.OpenIntents.org    Activities                      ActivityManagerService
OpenIntentswww.OpenIntents.org            ActivityManagerService●   Project: frameworks/base.git●   Package: com.android.s...
OpenIntents    www.OpenIntents.org       What does ActivityManagerService do ?●    Start, stop, pause,... Activities●    S...
OpenIntentswww.OpenIntents.org    What does ActivityManagerService do ?                      EVERYTHING
OpenIntentswww.OpenIntents.org         What does ActivityManagerService do ?                        EVERYTHING            ...
OpenIntentswww.OpenIntents.org         What does ActivityManagerService do ?                        EVERYTHING            ...
OpenIntents    www.OpenIntents.org                 Starting an Activity●    startActivity is called (calls startActivity(I...
OpenIntents    www.OpenIntents.org               Starting an Activity●    Class is resolved●    Permission check●    Infor...
OpenIntents    www.OpenIntents.org             Starting an Activity●    Add to History Stack●    Prepare Animations●    Ad...
OpenIntentswww.OpenIntents.org   Application ?
OpenIntentswww.OpenIntents.org   HistoryRecord
OpenIntentswww.OpenIntents.org   Application ?
OpenIntentswww.OpenIntents.org   Permissions
OpenIntentswww.OpenIntents.org   Permissions
OpenIntentswww.OpenIntents.org   Permissions
OpenIntentswww.OpenIntents.org              Changes in Gingerbread●   HistoryRecord renamed to ActivityRecord●   Introduct...
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents
Upcoming SlideShare
Loading in …5
×

Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents

1,107 views

Published on

Ronan Schwarz, OpenIntents

In this talk, we will once again walk through the Android Application fundamentals
- but this time from the Framework's point of View.
- You will learn why there is, in fact, no app - only a bunch of Activities.
- What a HistoryRecord is, what it is used for and it's implications for the lifecycle.
- Why ContentProviders are a type of service.
- How the Framework enforces Permissions across the system and what to make of it.
- Why Intents are even way better for RPC calls then is seen at first sight.
We will cover a lot of little tricks and some bigger parts of the Android framework and
it's implementation, giving you new insights for everyday development

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,107
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Droidcon 2011: Working with the Android source, Ronan Schwarz, Openintents

  1. 1. OpenIntents www.OpenIntents.org ANDROID FUNDAMENTALS REVISITED@_zerozero@openintents.biz
  2. 2. OpenIntents OpenIntents www.OpenIntents.org● Founded in 2009● Open Source based Company● Two times winners of Google Android Developer Challenge● Over 15 Apps in the Market (Free + Paid )● Services: ● Reusable components ● Intents Registry ● Developer Support ● Consulting ● App Development● Mentoring organization in Summer of Code 2011
  3. 3. OpenIntentswww.OpenIntents.org Topics ● Activity Lifecycle ● Activity Manager ● Concepts ● Components ● Why there is no App ● Permissions ● Gingerbread
  4. 4. OpenIntentswww.OpenIntents.org Who youre gonna call ?
  5. 5. OpenIntentswww.OpenIntents.org Activities ActivityManagerService
  6. 6. OpenIntentswww.OpenIntents.org ActivityManagerService● Project: frameworks/base.git● Package: com.android.server.am● Pure Java● Started by SystemServer, running as system process● Creates the System Context● Keeps a reference of the Home Screen / Launcher App
  7. 7. OpenIntents www.OpenIntents.org What does ActivityManagerService do ?● Start, stop, pause,... Activities● Start, stop, pause,... Services● Start, stop, pause,... ContentProviders● Check Permission● Broadcast Intents● Start, stop, pause,... Animations● Decide window focus● Deliver Hardware Events● Crash Activities
  8. 8. OpenIntentswww.OpenIntents.org What does ActivityManagerService do ? EVERYTHING
  9. 9. OpenIntentswww.OpenIntents.org What does ActivityManagerService do ? EVERYTHING the window manager doesnt
  10. 10. OpenIntentswww.OpenIntents.org What does ActivityManagerService do ? EVERYTHING the window manager doesnt (ok, almost)
  11. 11. OpenIntents www.OpenIntents.org Starting an Activity● startActivity is called (calls startActivity(Intent, -1)● ActivityManagerNative.startActivity(..)● Call gets dispatched via AIDL Binder to ActivityManagerService● Call is queued in a Handler Message Queue● startActivityXX is called● startActivityLocked is called
  12. 12. OpenIntents www.OpenIntents.org Starting an Activity● Class is resolved● Permission check● Inform Watchers● Create HistoryRecord● Check launch Flags● Create Task or add to existing● Grant Permissions
  13. 13. OpenIntents www.OpenIntents.org Starting an Activity● Add to History Stack● Prepare Animations● Add to WindowManager (creates window)● Pause currently running Activities● Switch Visibility● Calculate & update Configuration (may trigger reset)● Resume (make call across Binder into Activity Thread)● Set Focus● Ensure visibility
  14. 14. OpenIntentswww.OpenIntents.org Application ?
  15. 15. OpenIntentswww.OpenIntents.org HistoryRecord
  16. 16. OpenIntentswww.OpenIntents.org Application ?
  17. 17. OpenIntentswww.OpenIntents.org Permissions
  18. 18. OpenIntentswww.OpenIntents.org Permissions
  19. 19. OpenIntentswww.OpenIntents.org Permissions
  20. 20. OpenIntentswww.OpenIntents.org Changes in Gingerbread● HistoryRecord renamed to ActivityRecord● Introduction of Heavyweight Process ● Only one at any given time● Parts of lifecycle management moved to ActivityStack● Hardware Event / Key input was re-written● WindowManager now has an extra “secure” layer● ...● Beautified comments :)

×