overview of android (part 3): application framework & apps ... · 13 • an app registers...
TRANSCRIPT
![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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/1.jpg)
Overview of Android (Part 3):
Application Framework & Apps Layers
Douglas C. Schmidt
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/2.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/3.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/4.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/5.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/6.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/7.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/8.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/9.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/10.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/11.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/12.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/13.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/14.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/15.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/16.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/17.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/18.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/19.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/20.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/21.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/22.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/23.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/24.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/25.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/26.jpg)
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](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed2e03100aa243d381d039c/html5/thumbnails/27.jpg)
27
End of the Overview of Android (Part 3): Application
Framework & Apps