Slide 1

Slide 1 text

Android insights

Slide 2

Slide 2 text

WHAT IS ANDROID Android insights Open source mobile operating system Based on Linux Derivates for TVs, Cars and Watches Originally created by Google

Slide 3

Slide 3 text

SOURCE CODE Android insights 12.1 million LoC Apache 2 licensed 1,75M 2,1M 2,8M 3M 2,5M Other (Bash, Makefile) XML C Java C++

Slide 4

Slide 4 text

TIMELINE Android insights Sep 08 Feb 09 Apr 09 Oct 09 Android 1.0 Android 1.1 Android 1.0 Initial release Android 1.1 bug fix release Android 1.5 video recording copy & paste widgets Android 2.0 MS Exchange support new UI multi touch events

Slide 5

Slide 5 text

TIMELINE Android insights May 10 Dec 10 Feb 11 Oct 11 Android 2.2 JIT tethering push notifications Android 2.3 NFC real copy & paste improved GC Android 3.0 new UI HW accelerated rendering multi core support Android 4.0 Wifi direct VPN support merges 2.x and 3.x

Slide 6

Slide 6 text

TIMELINE Android insights Jul 12 Jul 13 Oct 13 Nov 14 Android 4.1 project butter (vsync) new notifications Android 4.3 BLE up to 4k resolution SELinux Android 4.4 ART Chrome based browser low memory optimizations Android 5.0 ART default 64bit support material UI

Slide 7

Slide 7 text

Android insights Open Source Created by Google huge codebase

Slide 8

Slide 8 text

Android vs. Linux

Slide 9

Slide 9 text

KERNEL Android vs. Linux drivers for memory management (pmem + ashmem ➔ ION) wakelocks logger aggressive and fine grained OOM killing

Slide 10

Slide 10 text

USERLAND Android vs. Linux custom libc ➔ Bionic no X11 ➔ skia user ID per app designed for fewer syscalls

Slide 11

Slide 11 text

BOOTING ANDROID Android vs. Linux Boot ROM Boot Loader Kernel Iinit Zygote Iinit Iinit Daemons System Services

Slide 12

Slide 12 text

minor kernel additions major userland changes Android vs. Linux

Slide 13

Slide 13 text

Hardware Abstraction Layer

Slide 14

Slide 14 text

OVERVIEW Hardware Abstraction Layer

Slide 15

Slide 15 text

HOW IT WORKS Hardware Abstraction Layer SDK Interface Service Native Service HAL Kernel Driver App

Slide 16

Slide 16 text

HOW IT WORKS Hardware Abstraction Layer SDK Interface Service Native Service HAL Kernel Driver App DisplayPowerController.java LightsService.java com_android_server_LightsService.cpp device//lights.c /sys/class/backlight/pwm-backlight/brightness

Slide 17

Slide 17 text

most of the OEMs don’t understand it chaos but its getting better PDK attempts to fix this Hardware Abstraction Layer

Slide 18

Slide 18 text

Execution Environment

Slide 19

Slide 19 text

APK Execution Environment Android application package Used for applications and middleware Contains the complete application signed by developer/google

Slide 20

Slide 20 text

STACK VS REGISTER Execution Environment pop 7 pop 20 add push result

Slide 21

Slide 21 text

STACK VS REGISTER Execution Environment add r1, r2, r7

Slide 22

Slide 22 text

ART Execution Environment Android Runtime not a process virtual machine ahead of time compilation llvm based

Slide 23

Slide 23 text

DALVIK Execution Environment

Slide 24

Slide 24 text

ART Execution Environment

Slide 25

Slide 25 text

PERFORMANCE Execution Environment 1,5-3 time faster execution an order of magnitude fast GC and alloc 4 times less GC pauses and heap resizes less fragmented heap

Slide 26

Slide 26 text

APK as packaging format ART replaces Dalvik huge theoretical performance gain with ART ahead of time optimizations Execution Environment

Slide 27

Slide 27 text

Interprocess Communication

Slide 28

Slide 28 text

OVERVIEW Interprocess Communication

Slide 29

Slide 29 text

INTENDS Interprocess Communication highest abstraction loose coupled asynchronous

Slide 30

Slide 30 text

BINDER Interprocess Communication Resides in Linux Kernel Transactional Uses shared memory behind the scenes Used for any IPC on Android Reference and identity aware

Slide 31

Slide 31 text

ASHMEM Interprocess Communication No abstraction bare memory file descriptor based used by the Binder

Slide 32

Slide 32 text

Binder is used nearly everywhere Intents for App development Interprocess Communication

Slide 33

Slide 33 text

Ecosystem

Slide 34

Slide 34 text

OHA Ecosystem open handset alliance 84 members members commit to support Android does it do anything?

Slide 35

Slide 35 text

FORKS Ecosystem AOSP every OEM maintains one for per device (family) chip vendors maintain forks (Codeauroa, TI, Nvidia …) open source project (CM, AOKP, …)

Slide 36

Slide 36 text

CYANOGENMOD Ecosystem biggest after market distribution at least 12 million active installs 220 supported devices single source tree for all devices

Slide 37

Slide 37 text

Thanks :-)