27
Overview of Android (Part 3): Application Framework & Apps Layers Douglas C. Schmidt [email protected] www.dre.vanderbilt.edu/~schmidt Professor of Computer Science Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee, USA

Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

Overview of Android (Part 3):

Application Framework & Apps Layers

Douglas C. Schmidt

[email protected]

www.dre.vanderbilt.edu/~schmidt

Professor of Computer Science

Institute for Software

Integrated Systems

Vanderbilt University

Nashville, Tennessee, USA

Page 2: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

2

Learning Objectives in this Part of the Lesson1. Understand what is an

application framework & know why it’s useful

Page 3: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

3

Learning Objectives in this Part of the Lesson1. Understand what is an

application framework & know why it’s useful

2. Recognize common system services in the AndroidApplication Framework layer

ART|Dalvik Virtual Machine

Page 4: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

4

Learning Objectives in this Part of the Lesson1. Understand what is an

application framework & know why it’s useful

2. Recognize common system services in the AndroidApplication Framework layer

3. Recognize common apps that are available on an Android device

ART|Dalvik Virtual Machine

Page 5: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

5

Overview of Application Frameworks

Page 6: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

6

Overview of Application Frameworks

See www.dre.vanderbilt.edu/~schmidt/frameworks.html

• A framework is an integrated set of components that provide a reusable architecture for a family of related apps

Page 7: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

7

• Frameworks use an event-driven programming model to plug app code into them

Register for event

Eventoccurs

Eventoccurs

See en.wikipedia.org/wiki/Event-driven_programming

ApplicationCode

FrameworkCode

Overview of Application Frameworks

Page 8: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

8

• Frameworks use an event-driven programming model to plug app code into them

• They enhance systematic reuse by providing canonical structure & functionality to apps

Register for event

Eventoccurs

Eventoccurs

ApplicationCode

FrameworkCode

Overview of Application Frameworks

See en.wikipedia.org/wiki/Code_reuse#Systematic_software_reuse

Page 9: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

9

• An app registers callbacks for specific types of events that can occur within the framework

Register for event

ApplicationCode

FrameworkCode

Eventoccurs

Eventoccurs

Overview of Application Frameworks

See en.wikipedia.org/wiki/Callback_(computer_programming)

Page 10: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

10

• An app registers callbacks for specific types of events that can occur within the framework

• A callback is an object passed as an argument to a framework

Register for event

ApplicationCode

FrameworkCode

Eventoccurs

Eventoccurs

Overview of Application Frameworks

See en.wikipedia.org/wiki/Callback_(computer_programming)

Page 11: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

11

• An app registers callbacks for specific types of events that can occur within the framework

• A callback is an object passed as an argument to a framework

• The framework monitors event sources for activity of interest

Register for event

Eventoccurs

Eventoccurs

ApplicationCode

FrameworkCode

Overview of Application Frameworks

e.g., arrival of network messages, clicks on

GUI components, etc.

See en.wikipedia.org/wiki/Callback_(computer_programming)

Page 12: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

12

• An app registers callbacks for specific types of events that can occur within the framework

• A callback is an object passed as an argument to a framework

• The framework monitors event sources for activity of interest

• Framework calls back the object when an event of interest occurs

Register for event

Eventoccurs

Eventoccurs

ApplicationCode

FrameworkCode

Overview of Application Frameworks

Page 13: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

13

• An app registers callbacks for specific types of events that can occur within the framework

• A callback is an object passed as an argument to a framework

• The framework monitors event sources for activity of interest

• Framework calls back the object when an event of interest occurs

• The app processing occurs in context of framework thread(s)

Register for event

Eventoccurs

Eventoccurs

ApplicationCode

FrameworkCode

Overview of Application Frameworks

Page 14: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

14

• When app callback is done control returns to the framework, where it waits for the next event to occur

Register for event

Eventoccurs

Eventoccurs

ApplicationCode

FrameworkCode

Overview of Application Frameworks

Page 15: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

15

• When app callback is done control returns to the framework, where it waits for the next event to occur

• Lather, rinse, repeat until app is done …

Register for event

Eventoccurs

Eventoccurs

ApplicationCode

FrameworkCode

Overview of Application Frameworks

See en.wikipedia.org/wiki/Lather,_rinse,_repeat

Page 16: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

16

Overview of the Android Application Framework

& Apps Layers

Page 17: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

17

ART|Dalvik Virtual Machine

• The Application framework layer contains system servicesthat provide apps with the capabilities & info they need to do their work

See opensourceforu.efytimes.com/2013/12/birds-eye-view-android-system-services

Overview of Android: Application Framework & Apps Layers

Page 18: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

18

• Expose hardware & Linux OS kernel capabilities to apps

• Run continuously during system operation

• Control flow is driven by various events & callbacks

ART|Dalvik Virtual Machine

• The Application framework layer contains system servicesthat provide apps with the capabilities & info they need to do their work

Overview of Android: Application Framework & Apps Layers

Page 19: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

19

• Expose hardware & Linux OS kernel capabilities to apps

• Run continuously during system operation

• Control flow is driven by various events & callbacks

ART|Dalvik Virtual Machine

• The Application framework layer contains system servicesthat provide apps with the capabilities & info they need to do their work

Overview of Android: Application Framework & Apps Layers

Page 20: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

20

Overview of Android: Application Framework & Apps Layers

• Expose hardware & Linux OS kernel capabilities to apps

• Run continuously during system operation

• Control flow is driven by various events & callbacks

ART|Dalvik Virtual Machine

• The Application framework layer contains system servicesthat provide apps with the capabilities & info they need to do their work

Page 21: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

21These system services are largely written in Java, with some C/C++ native code

ART|Dalvik Virtual Machine

• The Application framework layer contains system servicesthat provide apps with the capabilities & info they need to do their work

Overview of Android: Application Framework & Apps Layers

Page 22: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

22This service uses intents to interact with activities, services, & broadcast receivers

ART|Dalvik Virtual Machine

• The Application framework layer contains system servicesthat provide apps with the capabilities & info they need to do their work

Overview of Android: Application Framework & Apps Layers

We focus on the Activity Manager Service

throughout this course

Page 23: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

23

• Atop Android’s software stack are apps used every day

See android.googlesource.com/platform/packages/apps

Overview of Android: Application Framework & Apps Layers

Page 24: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

24

• Atop Android’s software stack are apps used every day

• The bulk of these appsare written in Java

Overview of Android: Application Framework & Apps Layers

Page 25: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

25

• Atop Android’s software stack are apps used every day

• The bulk of these appsare written in Java

• It’s also possible to writeapps in C/C++

See developer.android.com/ndk

Overview of Android: Application Framework & Apps Layers

Page 26: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

26

• Atop Android’s software stack are apps used every day

• The bulk of these appsare written in Java

• It’s also possible to writeapps in C/C++

• As well as Kotlin!

See developer.android.com/kotlin

Overview of Android: Application Framework & Apps Layers

Page 27: Overview of Android (Part 3): Application Framework & Apps ... · 13 • An app registers callbacks for specific types of events that can occur within the framework • A callback

27

End of the Overview of Android (Part 3): Application

Framework & Apps