![Page 1: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/1.jpg)
Overview of Android (Part 2):Middleware Infrastructure Layers
Douglas C. [email protected]
www.dre.vanderbilt.edu/~schmidtProfessor of Computer Science
Institute for Software Integrated Systems
Vanderbilt University Nashville, Tennessee, USA
![Page 2: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/2.jpg)
2
Learning Objectives in this Part of the Lesson1. Understand key elements
in Android’s middleware infrastructure
• e.g., hardware abstractionlayer, Android runtime, &native libraries
ART|Dalvik Virtual Machine
C++
/CC
Java
/JNI
Hardware components
Middleware infrastructure resides atop the OS & below the apps et al
![Page 3: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/3.jpg)
3
Learning Objectives in this Part of the Lesson1. Understand key elements
in Android’s middleware infrastructure
2. Name all the key app components in Android
![Page 4: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/4.jpg)
4
Learning Objectives in this Part of the Lesson1. Understand key elements
in Android’s middleware infrastructure
2. Name all the key app components in Android
3. Know what Java threads are in the context of Android
![Page 5: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/5.jpg)
5
Overview of Android’s Middleware
Infrastructure
![Page 6: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/6.jpg)
6
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms
ART|Dalvik Virtual Machine
C++
/CC
Java
/JNI
![Page 7: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/7.jpg)
7
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer
ART|Dalvik Virtual Machine
C++
/CC
Java
/JNI
See source.android.com/devices/#Hardware Abstraction Layer
![Page 8: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/8.jpg)
8
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer
• Shields Android stack from low-level hardware details
ART|Dalvik Virtual Machine
C++
/CC
Java
/JNI
Hardware components
![Page 9: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/9.jpg)
9
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer
• Shields Android stack from low-level hardware details
• Shields OEMs from GNUPublic License “virality”
ART|Dalvik Virtual Machine
C++
/CC
Hardware components
Java
/JNI
See en.wikipedia.org/wiki/Linux_kernel#Licensing_terms
![Page 10: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/10.jpg)
10
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
ART|Dalvik Virtual Machine
C++
/CC
Hardware components
Java
/JNI
This layer is composed of several middleware elements
![Page 11: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/11.jpg)
11
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
This element is composed of two parts
![Page 12: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/12.jpg)
12
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
A managed execution environment that
efficiently runs Java-based apps & some
Android system services
See source.android.com/devices/tech/dalvik
![Page 13: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/13.jpg)
13
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtime
See sites.google.com/site/io/dalvik-vm-internals
ART|Dalvik Virtual Machine
Java
/JNI
C++
/CCThis managed
execution environment is optimized for mobile
device constraints
![Page 14: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/14.jpg)
14
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CCA copy of core Java
class libraries & core Android class libraries
See en.wikipedia.org/wiki/Comparison_of_Java_and_Android_API
![Page 15: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/15.jpg)
15
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
We’ll discuss Java threading shortly
![Page 16: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/16.jpg)
16
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
Android’s core libraries provide key components that we’ll also cover shortly
Content Provider
ServiceActivity
Broadcast Receiver
![Page 17: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/17.jpg)
17
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
Android’s core libraries provide many other UI & persistence components
![Page 18: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/18.jpg)
18
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
![Page 19: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/19.jpg)
19
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtime
We cover Android’s core libraries in the Android App Development Specialization
ART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
![Page 20: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/20.jpg)
20
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
Android—like Java—balances run-time performance & developer productivity
Productivity Performance
![Page 21: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/21.jpg)
21
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtimeART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
See www.dre.vanderbilt.edu/~schmidt/PDF/wrapper-facade.pdf
Android’s core libraries are often implemented
as wrapper facades
![Page 22: Overview of Android (Part 2): Middleware Infrastructure Layers · 2 Learning Objectives in this Part of the Lesson 1. Understand key elements in Android’s middleware infrastructure](https://reader036.vdocuments.net/reader036/viewer/2022070922/5fba3ac6f385b845e16eec8a/html5/thumbnails/22.jpg)
22
Overview of Android’s Middleware Infrastructure• Android’s middleware infrastructure provides reusable capabilities that
extend hardware-centric OS kernel & protocol mechanisms• Hardware abstraction layer• Runtime & libraries layer
• Android runtime• Native C/C++ libraries ART|Dalvik Virtual Machine
Java
/JNI
C++
/CC
See developer.android.com/tools/sdk/ndk
These Java wrapper façade are implemented via native C/C++ code