Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android insights

Android insights


Kolja Dummann

November 07, 2014

More Decks by Kolja Dummann

Other Decks in Technology


  1. Android insights

  2. WHAT IS ANDROID Android insights Open source mobile operating system

    Based on Linux Derivates for TVs, Cars and Watches Originally created by Google
  3. 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++
  4. 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
  5. 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
  6. 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
  7. Android insights Open Source Created by Google huge codebase

  8. Android vs. Linux

  9. KERNEL Android vs. Linux drivers for memory management (pmem +

    ashmem ➔ ION) wakelocks logger aggressive and fine grained OOM killing
  10. USERLAND Android vs. Linux custom libc ➔ Bionic no X11

    ➔ skia user ID per app designed for fewer syscalls
  11. BOOTING ANDROID Android vs. Linux Boot ROM Boot Loader Kernel

    Iinit Zygote Iinit Iinit Daemons System Services
  12. minor kernel additions major userland changes Android vs. Linux

  13. Hardware Abstraction Layer

  14. OVERVIEW Hardware Abstraction Layer

  15. HOW IT WORKS Hardware Abstraction Layer SDK Interface Service Native

    Service HAL Kernel Driver App
  16. 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/<path do device>/lights.c /sys/class/backlight/pwm-backlight/brightness
  17. most of the OEMs don’t understand it chaos but its

    getting better PDK attempts to fix this Hardware Abstraction Layer
  18. Execution Environment

  19. APK Execution Environment Android application package Used for applications and

    middleware Contains the complete application signed by developer/google
  20. STACK VS REGISTER Execution Environment pop 7 pop 20 add

    push result
  21. STACK VS REGISTER Execution Environment add r1, r2, r7

  22. ART Execution Environment Android Runtime not a process virtual machine

    ahead of time compilation llvm based
  23. DALVIK Execution Environment

  24. ART Execution Environment

  25. 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
  26. APK as packaging format ART replaces Dalvik huge theoretical performance

    gain with ART ahead of time optimizations Execution Environment
  27. Interprocess Communication

  28. OVERVIEW Interprocess Communication

  29. INTENDS Interprocess Communication highest abstraction loose coupled asynchronous

  30. BINDER Interprocess Communication Resides in Linux Kernel Transactional Uses shared

    memory behind the scenes Used for any IPC on Android Reference and identity aware
  31. ASHMEM Interprocess Communication No abstraction bare memory file descriptor based

    used by the Binder
  32. Binder is used nearly everywhere Intents for App development Interprocess

  33. Ecosystem

  34. OHA Ecosystem open handset alliance 84 members members commit to

    support Android does it do anything?
  35. FORKS Ecosystem AOSP every OEM maintains one for per device

    (family) chip vendors maintain forks (Codeauroa, TI, Nvidia …) open source project (CM, AOKP, …)
  36. CYANOGENMOD Ecosystem biggest after market distribution at least 12 million

    active installs 220 supported devices single source tree for all devices
  37. Thanks :-)