Top Banner
Overview of Android (Part 2): Middleware Infrastructure 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
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

Aug 16, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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