SlideShare a Scribd company logo
1 of 53
Download to read offline
Embedded Android
   Workshop
Part 1 - Android Internals
    Linaro Connect Asia 2013

       Karim Yaghmour
       @karimyaghmour


                               1
These slides are made available to you under a Creative Commons          Delivered and/or customized by
Share-Alike 3.0 license. The full terms of this license are here:
https://creativecommons.org/licenses/by-sa/3.0/


Attribution requirements and misc., PLEASE READ:
●   This slide must remain as-is in this specific location (slide #2),
    everything else you are free to change; including the logo :-)
●   Use of figures in other documents must feature the below
    “Originals at” URL immediately under that figure and the below
    copyright notice where appropriate.
●   You are free to fill in the “Delivered and/or customized by” space
    on the right as you see fit.
●   You are FORBIDEN from using the default “About” slide as-is or
    any of its contents.


(C) Copyright 2010-2013, Opersys inc.
These slides created by: Karim Yaghmour
Originals at: www.opersys.com/community/docs
                                                                                  2
About
●   Author of:




●   Introduced Linux Trace Toolkit in 1999
●   Originated Adeos and relayfs (kernel/relay.c)
●   Training, Custom Dev, Consulting, ...
                                              3
About Android
●   Huge
●   Fast moving
●   Stealthy




                                  4
1. Android Concepts       9. JNI
2. Framework Intro        10.System Server
3. Overall Architecture   11.Calling on Services
4. System startup         12.Activity Manager
5. Linux Kernel           13.Binder
6. Hardware Support       14.HAL
7. Native User-Space      15.Stock AOSP Apps
8. Dalvik                 16.Case-in-Point
                                        5
1. Android Concepts
●   Components
●   Intents
●   Component lifecycle
●   Manifest file
●   Processes and threads
●   Remote procedure calls



                                    6
1.1. Components
●   1 App = N Components
●   Apps can use components of other applications
●   App processes are automagically started whenever any
    part is needed
●   Ergo: N entry points, !1, and !main()
●   Components:
    ●   Activities
    ●   Services
    ●   Broadcast Receivers
    ●   Content Providers
                                              7
1.2. Intents
●   Intent = asynchronous message w/ or w/o
    designated target
●   Like a polymorphic Unix signal, but w/o
    required target
●   Intents “payload” held in Intent Object
●   Intent Filters specified in Manifest file




                                                8
1.3. Component lifecycle
●   System automagically starts/stops/kills
    processes:
    ●   Entire system behaviour predicated on low memory
●   System triggers Lifecycle callbacks when
    relevant
●   Ergo: Must manage Component Lifecycle
●   Some Components are more complex to
    manage than others

                                             9
10
1.4. Manifest file
●   Informs system about app’s components
●   XML format
●   Always called AndroidManifest.xml
●   Activity = <activity> ... static
●   Service = <service> ... static
●   Broadcast Receiver:
    ●   Static = <receiver>
    ●   Dynamic = Context.registerReceiver()
●   Content Provider = <provider> ... static
                                               11
1.5. Processes and threads
●   Processes
    ●   Default: all callbacks to any app Component are issued to the main process thread
    ●   <activity>—<service>—<recipient>—<provider> have process attribute to override
        default
    ●   Do NOT perform blocking/long operations in main process thread:
        –   Spawn threads instead
    ●   Process termination/restart is at system’s discretion
    ●   Therefore:
        –   Must manage Component Lifecycle
●   Threads:
    ●   Create using the regular Java Thread Object
    ●   Android API provides thread helper classes:
        –   Looper: for running a message loop with a thread
        –   Handler: for processing messages
        –   HandlerThread: for setting up a thread with a message loop

                                                                         12
1.6. Remote procedure calls
●   Android RPCs = Binder mechanism
●   No Sys V IPC due to in-kernel resource leakage
●   Binder is a low-level functionality, not used as-is
●   Instead: must define interface using Interface
    Definition Language (IDL)
●   IDL fed to aidl Tool to generate Java interface
    definitions


                                           13
2. Framework Introduction
●   UI
●   Data storage
●   Security/Permissions
●   ... and much more ... :
    ●    Graphics
    ●    Audio and Video
    ●    Location and Maps
    ●    Bluetooth
    ●    NFC
                                 14
2.1. UI
●   Everything based on hierarchy of Views and
    ViewGroups (layouts)
●   Declared in XML or dynamically through Java
●   UI components:
    ●   Widgets
    ●   Event handlers
    ●   Menus
    ●   Dialogs
    ●   Notifications
    ●   ...
                                           15
2.2. Data storage
●   Shared preferences
    ●   Private primitive key-pair values
●   Internal storage
    ●   Private data on device memory
●   External storage
    ●   Public data on shared external device (SD)
●   SQLite DB
    ●   Private DB
●   Network connection
    ●   Web-based storage (REST)
                                                     16
2.3. Security/Permissions
●   Most security enforced at process level: UID, GID
●   Permissions enforce restrictions on:
    ●   Per-process operations
    ●   Per-URI access
●   Applications are sandboxed
●   Specific permissions required to “exit” sandbox
●   Decision to grant access based on:
    ●   Certificates
    ●   User prompts
●   All permissions must be declared statically
                                                  17
2.4. Native development
●   Useful for:
    ●   Porting existing body of code to Android
    ●   Developing optimized native apps, especially for gaming
●   Provides:
    ●   Tools and build files to generate native code libraries from C/C++
    ●   Way to embed native libs into .apk
    ●   Set of stable (forward-compatible) native libs
    ●   Documentation, samples and tutorials
●   Enables:
    ●   Calling native code from Java using JNI
    ●   Implementing fully native apps (since 2.3)
●   Doesn't allow you to:
    ●   Compile traditional Linux/Unix apps as-is
                                                                      18
3. Architecture
●   Embedded Linux
●   Modern phone/tablet
●   System-on-Chip (SoC)
●   Android




                                 19
20
21
22
23
4. System Startup
●   Bootloader
●   Kernel
●   Init
●   Zygote
●   System Server
●   Activity Manager
●   Launcher (Home)

                                  24
4.1. Bootloader
●   aosp/bootable/bootloader
    ●   Custom bootloader for Android
    ●   USB-based
    ●   Implements the “fastboot” protocol
    ●   Controlled via “fastboot” cli tool on host
●   aosp/bootable/recovery
    ●   UI-based recovery boot program
    ●   Accessed through magic key sequence at boot
    ●   Usually manufacturer specific variant
                                                     25
●   Flash layout:

          0x000003860000­0x000003900000 : "misc"
          0x000003900000­0x000003e00000 : "recovery"
          0x000003e00000­0x000004300000 : "boot"        Kernel
          0x000004300000­0x00000c300000 : "system"      /system
          0x00000c300000­0x0000183c0000 : "userdata"    /data
          0x0000183c0000­0x00001dd20000 : "cache"       /cache
          0x00001dd20000­0x00001df20000 : "kpanic"
          0x00001df20000­0x00001df60000 : "dinfo"
          0x00001df60000­0x00001dfc0000 : "setupdata"
          0x00001dfc0000­0x00001e040000 : "splash1"
          0x000000300000­0x000001680000 : "modem"
                         From Acer Liquid-E


                                                  26
4.2. Kernel
●   Early startup code is very hardware dependent
●   Initializes environment for the running of C code
●   Jumps to the architecture-independent
    start_kernel() function.
●   Initializes high-level kernel subsystems
●   Mounts root filesystem
●   Starts the init process


                                          27
4.3. Android Init
●   Open, parses, and runs /init.rc:
    ●   Create mountpoints and mount filesystems
    ●   Set up filesystem permissions
    ●   Set OOM adjustments properties
    ●   Start daemons:
        –   adbd
        –   servicemanager (binder context manager)
        –   vold
        –   netd
        –   rild
        –   app_process -Xzygote (Zygote)
        –   mediaserver
        –   ...


                                                      28
4.4. Zygote, etc.
●   Init:
    ●   app_process -Xzygote (Zygote)
●   frameworks/base/cmds/app_process/app_main.cpp:
    ●   runtime.start(“com.android.internal.os.Zygote”, ...
●   frameworks/base/core/jni/AndroidRuntime.cpp:
    ●   startVM()
    ●   Call Zygote's main()
●   frameworks/base/core/java/com/android/internal/os/Zy
    goteInit.java:
    ●   ...
                                                        29
●   preloadClasses()
    ●   startSystemServer()
    ●   ... magic ...
    ●   Call SystemServer's run()
●   frameworks/base/services/java/com/android/server
    /SystemServer.java:
    ●   Start all system services/managers
    ●   Start ActivityManager:
         –   Send Intent.CATEGORY_HOME
         –   Launcher2 kicks in
                                             30
5. Linux Kernel




                  31
5.1. Androidisms
●   Wakelocks
●   lowmem handler
●   Binder
●   ashmem – Anonymous Shared Memory
●   RAM console
●   Logger
●   ...

                                   32
6. Hardware support
Bluetooth               BlueZ through D-BUS IPC (to avoid GPL contamination it seems)
GPS                     Manufacturer-provided libgps.so
Wifi                    wpa_supplicant
Display                 Std framebuffer driver (/dev/fb0)
Keymaps and Keyboards   Std input event (/dev/event0)
Lights                  Manufacturer-provided liblights.so
     Backlight
     Keyboard
     Buttons
     Battery
     Notifications
     Attention
Audio                   Manufacturer-provided libaudio.so (could use ALSA underneath ... at least as illustrated in their porting guide)
Camera                  Manufacturer-provided libcamera.so (could use V4L2 kernel driver underneath ... as illustrated in porting guide)
Power Management        “Wakelocks” kernel patch
Sensors                 Manufacturer-provided libsensors.so
     Accelerometer
     Magnetic Field
     Orientation
     Gyroscope
     Light
     Pressure
     Temperature
     Proximity
Radio Layer Interface   Manufacturer-provided libril-<companyname>-<RIL version>.so




                                                                                                      33
7. Native User-Space
●   Mainly
    ●   /data    => User data
    ●   /system => System components
●   Also found:
    ●   /dev
    ●   /proc
    ●   /sys
    ●   /sbin
    ●   /mnt
    ●   /cache
    ●   Etc.
                                       34
●   Libs:
     Bionic, SQLite, SSL, OpenGL|ES,
     Non-Posix: limited Pthreads support, no SysV IPC
●   Toolbox
●   Daemons:
     servicemanager, vold, rild, netd, adbd, ...



                                            35
8. Dalvik
●   Sun-Java =
        Java language + JVM + JDK libs
●   Android Java =
        Java language + Dalvik + Apache Harmony
●   Target:
    ●   Slow CPU
    ●   Relatively low RAM
    ●   OS without swap space
    ●   Battery powered
●   Now has JIT
                                              36
8.1. Dalvik's .dex files
●   JVM munches on “.class” files
●   Dalvik munches on “.dex” files
●   .dex file = .class files post-processed by “dx”
    utility
●   Uncompressed .dex = 0.5 * Uncompressed .jar




                                           37
9. JNI – Java Native Interface
●   Call gate for other languages, such as C, C++
●   Equivalent to .NET's pinvoke
●   Usage: include and call native code from App
●   Tools = NDK ... samples included
●   Check out “JNI Programmer's Guide and
    Specification” - freely available PDF



                                        38
10. System Services
Entropy Service            Device Policy               Audio Service
Power Manager              Status Bar                  Headset Observer
Activity Manager           Clipboard Service           Dock Observer
Telephone Registry         Input Method Service        UI Mode Manager Service
Package Manager            NetStat Service             Backup Service
Account Manager            NetworkManagement Service   AppWidget Service
Content Manager            Connectivity Service        Recognition Service
System Content Providers   Throttle Service            Status Bar Icons
Battery Service            Accessibility Manager       DiskStats Service
Lights Service             Mount Service               ADB Settings Observer
Vibrator Service           Notification Manager
Alarm Manager              Device Storage Monitor
Init Watchdog              Location Manager
Sensor Service             Search Service
Window Manager             DropBox Service
Bluetooth Service          Wallpaper Service


                                                             39
40
11. Calling on System Services
●   Use getSystemService
●   Ex: NotificationManager Object reference:
     String ns = Context.NOTIFICATION_SERVICE;
     NotificationManager mNotificationManager = (NotificationManager) 
     getSystemService(ns);

●   Prepare your content
●   Call on the object:
     mNotificationManager.notify(HELLO_ID, notification);




                                                            41
12. ActivityManager
●   Start new Activities, Services
●   Fetch Content Providers
●   Intent broadcasting
●   OOM adj. maintenance
●   Application Not Responding
●   Permissions
●   Task management
●   Lifecycle management
                                     42
●   Ex. starting new app from Launcher:
      ●   onClick(Launcher)
      ●   startActivity(Activity.java)
      ●   <Binder>
      ●   ActivityManagerService
      ●   startViaZygote(Process.java)
      ●   <Socket>
      ●   Zygote


                                          43
13. Binder
●   CORBA/COM-like IPC
●   Data sent through “parcels” in “transactions”
●   Kernel-supported mechanism
●   /dev/binder
●   Check /proc/binder/*
●   android.* API connected to System Server
    through binder.


                                          44
45
14. Hardware Abstraction Layer
                           /frameworks/base/core/...


                           /frameworks/base/services/java/...
AOSP-provided
    ASL
                           /frameworks/base/services/jni/


                           /hardware/libhardware/

                           /device/[MANUF.]/[DEVICE]
Manuf.-provided            /sdk/emulator/
Manuf. license
                           Kernel or module
Manuf.-provided
 GPL-license


                                     46
15. Stock AOSP Apps

/packages/apps                            /packages/providers      /packages/inputmethods

AccountsAndSettings    Launcher2          ApplicationProvider      LatinIME
AlarmClock             Mms                CalendarProvider         OpenWnn
Bluetooth              Music              ContactsProvider         PinyinIME
Browser                PackageInstaller   DownloadProvider
Calculator             Protips            DrmProvider
Calendar               Provision          GoogleContactsProvider
Camera                 QuickSearchBox     MediaProvider
CertInstaller          Settings           TelephonyProvider
Contacts               SoundRecorder      UserDictionaryProvider
DeskClock              SpeechRecorder
Email                  Stk
Gallery                VoiceDialer
HTMLViewer




                                                                   47
16. Case-in-point: Display Architecture
●   Display Hardware
●   Classic Linux display stack
●   Display stack in Android




                                  48
16.1. Display Hardware


  MMU




 IOMMU




                    49
16.2. Classic Linux display stack




                           50
16.3. Display stack in Android




                         51
52
Thank you ...


karim.yaghmour@opersys.com




                         53

More Related Content

What's hot

Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
Inter-process communication of Android
Inter-process communication of AndroidInter-process communication of Android
Inter-process communication of AndroidTetsuyuki Kobayashi
 

What's hot (20)

Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Inter-process communication of Android
Inter-process communication of AndroidInter-process communication of Android
Inter-process communication of Android
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
 

Viewers also liked

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIOpersys inc.
 
Embedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC EuropeEmbedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC EuropeOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011Opersys inc.
 
Extending Android with New Devices
Extending Android with New DevicesExtending Android with New Devices
Extending Android with New DevicesShree Kumar
 
Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyBenjamin Zores
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930weitulislide
 
Android Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-PlattformAndroid Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-Plattforminovex GmbH
 
Embedded Android Market Development
Embedded Android Market DevelopmentEmbedded Android Market Development
Embedded Android Market DevelopmentVIA Embedded
 
Embedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming OptimizationEmbedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming OptimizationVIA Embedded
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
The Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFVThe Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFVOPNFV
 
Remote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesRemote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesVIA Embedded
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 

Viewers also liked (20)

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VI
 
Embedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC EuropeEmbedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC Europe
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011Embedded Android Workshop at Embedded Linux Conference Europe 2011
Embedded Android Workshop at Embedded Linux Conference Europe 2011
 
Extending Android with New Devices
Extending Android with New DevicesExtending Android with New Devices
Extending Android with New Devices
 
Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform Anatomy
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930Android porting-on-embedded-platform v2-0633850602027036930
Android porting-on-embedded-platform v2-0633850602027036930
 
Android Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-PlattformAndroid Embedded - Einführung in Android als Embedded-Plattform
Android Embedded - Einführung in Android als Embedded-Plattform
 
Embedded Android Market Development
Embedded Android Market DevelopmentEmbedded Android Market Development
Embedded Android Market Development
 
Embedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming OptimizationEmbedded Android Real-Time Streaming Optimization
Embedded Android Real-Time Streaming Optimization
 
Embedded android development (e book)
Embedded android development (e book)Embedded android development (e book)
Embedded android development (e book)
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
The Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFVThe Third Network: LSO, SDN and NFV
The Third Network: LSO, SDN and NFV
 
Remote Management of Embedded Android Devices
Remote Management of Embedded Android DevicesRemote Management of Embedded Android Devices
Remote Management of Embedded Android Devices
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 

Similar to Android Internals at Linaro Connect Asia 2013

Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Opersys inc.
 
Android Security, From the Ground Up
Android Security, From the Ground UpAndroid Security, From the Ground Up
Android Security, From the Ground UpOpersys inc.
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIOpersys inc.
 
Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel HackingDeveler S.r.l.
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Opersys inc.
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteOpersys inc.
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Opersys inc.
 
embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdftwtester
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemdAlison Chaiken
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Opersys inc.
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform ToolsOpersys inc.
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesMender.io
 

Similar to Android Internals at Linaro Connect Asia 2013 (20)

Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Android Attacks
Android AttacksAndroid Attacks
Android Attacks
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
 
Android Security, From the Ground Up
Android Security, From the Ground UpAndroid Security, From the Ground Up
Android Security, From the Ground Up
 
Headless Android
Headless AndroidHeadless Android
Headless Android
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
 
Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel Hacking
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
 
Extending Android's Platform Toolsuite
Extending Android's Platform ToolsuiteExtending Android's Platform Toolsuite
Extending Android's Platform Toolsuite
 
Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013Running Code in the Android Stack at ELCE 2013
Running Code in the Android Stack at ELCE 2013
 
embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdf
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemd
 
Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014Running Code in the Android Stack at ABS 2014
Running Code in the Android Stack at ABS 2014
 
Android OS
Android OSAndroid OS
Android OS
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform Tools
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSes
 

More from Opersys inc.

Android Automotive
Android AutomotiveAndroid Automotive
Android AutomotiveOpersys inc.
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals UpdateOpersys inc.
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with PieOpersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with OreoOpersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoTOpersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 

More from Opersys inc. (20)

Android Automotive
Android AutomotiveAndroid Automotive
Android Automotive
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals Update
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Project Ara
Project AraProject Ara
Project Ara
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Brillo/Weave Internals
Brillo/Weave InternalsBrillo/Weave Internals
Brillo/Weave Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 

Recently uploaded

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 

Android Internals at Linaro Connect Asia 2013

  • 1. Embedded Android Workshop Part 1 - Android Internals Linaro Connect Asia 2013 Karim Yaghmour @karimyaghmour 1
  • 2. These slides are made available to you under a Creative Commons Delivered and/or customized by Share-Alike 3.0 license. The full terms of this license are here: https://creativecommons.org/licenses/by-sa/3.0/ Attribution requirements and misc., PLEASE READ: ● This slide must remain as-is in this specific location (slide #2), everything else you are free to change; including the logo :-) ● Use of figures in other documents must feature the below “Originals at” URL immediately under that figure and the below copyright notice where appropriate. ● You are free to fill in the “Delivered and/or customized by” space on the right as you see fit. ● You are FORBIDEN from using the default “About” slide as-is or any of its contents. (C) Copyright 2010-2013, Opersys inc. These slides created by: Karim Yaghmour Originals at: www.opersys.com/community/docs 2
  • 3. About ● Author of: ● Introduced Linux Trace Toolkit in 1999 ● Originated Adeos and relayfs (kernel/relay.c) ● Training, Custom Dev, Consulting, ... 3
  • 4. About Android ● Huge ● Fast moving ● Stealthy 4
  • 5. 1. Android Concepts 9. JNI 2. Framework Intro 10.System Server 3. Overall Architecture 11.Calling on Services 4. System startup 12.Activity Manager 5. Linux Kernel 13.Binder 6. Hardware Support 14.HAL 7. Native User-Space 15.Stock AOSP Apps 8. Dalvik 16.Case-in-Point 5
  • 6. 1. Android Concepts ● Components ● Intents ● Component lifecycle ● Manifest file ● Processes and threads ● Remote procedure calls 6
  • 7. 1.1. Components ● 1 App = N Components ● Apps can use components of other applications ● App processes are automagically started whenever any part is needed ● Ergo: N entry points, !1, and !main() ● Components: ● Activities ● Services ● Broadcast Receivers ● Content Providers 7
  • 8. 1.2. Intents ● Intent = asynchronous message w/ or w/o designated target ● Like a polymorphic Unix signal, but w/o required target ● Intents “payload” held in Intent Object ● Intent Filters specified in Manifest file 8
  • 9. 1.3. Component lifecycle ● System automagically starts/stops/kills processes: ● Entire system behaviour predicated on low memory ● System triggers Lifecycle callbacks when relevant ● Ergo: Must manage Component Lifecycle ● Some Components are more complex to manage than others 9
  • 10. 10
  • 11. 1.4. Manifest file ● Informs system about app’s components ● XML format ● Always called AndroidManifest.xml ● Activity = <activity> ... static ● Service = <service> ... static ● Broadcast Receiver: ● Static = <receiver> ● Dynamic = Context.registerReceiver() ● Content Provider = <provider> ... static 11
  • 12. 1.5. Processes and threads ● Processes ● Default: all callbacks to any app Component are issued to the main process thread ● <activity>—<service>—<recipient>—<provider> have process attribute to override default ● Do NOT perform blocking/long operations in main process thread: – Spawn threads instead ● Process termination/restart is at system’s discretion ● Therefore: – Must manage Component Lifecycle ● Threads: ● Create using the regular Java Thread Object ● Android API provides thread helper classes: – Looper: for running a message loop with a thread – Handler: for processing messages – HandlerThread: for setting up a thread with a message loop 12
  • 13. 1.6. Remote procedure calls ● Android RPCs = Binder mechanism ● No Sys V IPC due to in-kernel resource leakage ● Binder is a low-level functionality, not used as-is ● Instead: must define interface using Interface Definition Language (IDL) ● IDL fed to aidl Tool to generate Java interface definitions 13
  • 14. 2. Framework Introduction ● UI ● Data storage ● Security/Permissions ● ... and much more ... : ● Graphics ● Audio and Video ● Location and Maps ● Bluetooth ● NFC 14
  • 15. 2.1. UI ● Everything based on hierarchy of Views and ViewGroups (layouts) ● Declared in XML or dynamically through Java ● UI components: ● Widgets ● Event handlers ● Menus ● Dialogs ● Notifications ● ... 15
  • 16. 2.2. Data storage ● Shared preferences ● Private primitive key-pair values ● Internal storage ● Private data on device memory ● External storage ● Public data on shared external device (SD) ● SQLite DB ● Private DB ● Network connection ● Web-based storage (REST) 16
  • 17. 2.3. Security/Permissions ● Most security enforced at process level: UID, GID ● Permissions enforce restrictions on: ● Per-process operations ● Per-URI access ● Applications are sandboxed ● Specific permissions required to “exit” sandbox ● Decision to grant access based on: ● Certificates ● User prompts ● All permissions must be declared statically 17
  • 18. 2.4. Native development ● Useful for: ● Porting existing body of code to Android ● Developing optimized native apps, especially for gaming ● Provides: ● Tools and build files to generate native code libraries from C/C++ ● Way to embed native libs into .apk ● Set of stable (forward-compatible) native libs ● Documentation, samples and tutorials ● Enables: ● Calling native code from Java using JNI ● Implementing fully native apps (since 2.3) ● Doesn't allow you to: ● Compile traditional Linux/Unix apps as-is 18
  • 19. 3. Architecture ● Embedded Linux ● Modern phone/tablet ● System-on-Chip (SoC) ● Android 19
  • 20. 20
  • 21. 21
  • 22. 22
  • 23. 23
  • 24. 4. System Startup ● Bootloader ● Kernel ● Init ● Zygote ● System Server ● Activity Manager ● Launcher (Home) 24
  • 25. 4.1. Bootloader ● aosp/bootable/bootloader ● Custom bootloader for Android ● USB-based ● Implements the “fastboot” protocol ● Controlled via “fastboot” cli tool on host ● aosp/bootable/recovery ● UI-based recovery boot program ● Accessed through magic key sequence at boot ● Usually manufacturer specific variant 25
  • 26. Flash layout: 0x000003860000­0x000003900000 : "misc" 0x000003900000­0x000003e00000 : "recovery" 0x000003e00000­0x000004300000 : "boot" Kernel 0x000004300000­0x00000c300000 : "system" /system 0x00000c300000­0x0000183c0000 : "userdata" /data 0x0000183c0000­0x00001dd20000 : "cache" /cache 0x00001dd20000­0x00001df20000 : "kpanic" 0x00001df20000­0x00001df60000 : "dinfo" 0x00001df60000­0x00001dfc0000 : "setupdata" 0x00001dfc0000­0x00001e040000 : "splash1" 0x000000300000­0x000001680000 : "modem" From Acer Liquid-E 26
  • 27. 4.2. Kernel ● Early startup code is very hardware dependent ● Initializes environment for the running of C code ● Jumps to the architecture-independent start_kernel() function. ● Initializes high-level kernel subsystems ● Mounts root filesystem ● Starts the init process 27
  • 28. 4.3. Android Init ● Open, parses, and runs /init.rc: ● Create mountpoints and mount filesystems ● Set up filesystem permissions ● Set OOM adjustments properties ● Start daemons: – adbd – servicemanager (binder context manager) – vold – netd – rild – app_process -Xzygote (Zygote) – mediaserver – ... 28
  • 29. 4.4. Zygote, etc. ● Init: ● app_process -Xzygote (Zygote) ● frameworks/base/cmds/app_process/app_main.cpp: ● runtime.start(“com.android.internal.os.Zygote”, ... ● frameworks/base/core/jni/AndroidRuntime.cpp: ● startVM() ● Call Zygote's main() ● frameworks/base/core/java/com/android/internal/os/Zy goteInit.java: ● ... 29
  • 30. preloadClasses() ● startSystemServer() ● ... magic ... ● Call SystemServer's run() ● frameworks/base/services/java/com/android/server /SystemServer.java: ● Start all system services/managers ● Start ActivityManager: – Send Intent.CATEGORY_HOME – Launcher2 kicks in 30
  • 32. 5.1. Androidisms ● Wakelocks ● lowmem handler ● Binder ● ashmem – Anonymous Shared Memory ● RAM console ● Logger ● ... 32
  • 33. 6. Hardware support Bluetooth BlueZ through D-BUS IPC (to avoid GPL contamination it seems) GPS Manufacturer-provided libgps.so Wifi wpa_supplicant Display Std framebuffer driver (/dev/fb0) Keymaps and Keyboards Std input event (/dev/event0) Lights Manufacturer-provided liblights.so Backlight Keyboard Buttons Battery Notifications Attention Audio Manufacturer-provided libaudio.so (could use ALSA underneath ... at least as illustrated in their porting guide) Camera Manufacturer-provided libcamera.so (could use V4L2 kernel driver underneath ... as illustrated in porting guide) Power Management “Wakelocks” kernel patch Sensors Manufacturer-provided libsensors.so Accelerometer Magnetic Field Orientation Gyroscope Light Pressure Temperature Proximity Radio Layer Interface Manufacturer-provided libril-<companyname>-<RIL version>.so 33
  • 34. 7. Native User-Space ● Mainly ● /data => User data ● /system => System components ● Also found: ● /dev ● /proc ● /sys ● /sbin ● /mnt ● /cache ● Etc. 34
  • 35. Libs: Bionic, SQLite, SSL, OpenGL|ES, Non-Posix: limited Pthreads support, no SysV IPC ● Toolbox ● Daemons: servicemanager, vold, rild, netd, adbd, ... 35
  • 36. 8. Dalvik ● Sun-Java = Java language + JVM + JDK libs ● Android Java = Java language + Dalvik + Apache Harmony ● Target: ● Slow CPU ● Relatively low RAM ● OS without swap space ● Battery powered ● Now has JIT 36
  • 37. 8.1. Dalvik's .dex files ● JVM munches on “.class” files ● Dalvik munches on “.dex” files ● .dex file = .class files post-processed by “dx” utility ● Uncompressed .dex = 0.5 * Uncompressed .jar 37
  • 38. 9. JNI – Java Native Interface ● Call gate for other languages, such as C, C++ ● Equivalent to .NET's pinvoke ● Usage: include and call native code from App ● Tools = NDK ... samples included ● Check out “JNI Programmer's Guide and Specification” - freely available PDF 38
  • 39. 10. System Services Entropy Service Device Policy Audio Service Power Manager Status Bar Headset Observer Activity Manager Clipboard Service Dock Observer Telephone Registry Input Method Service UI Mode Manager Service Package Manager NetStat Service Backup Service Account Manager NetworkManagement Service AppWidget Service Content Manager Connectivity Service Recognition Service System Content Providers Throttle Service Status Bar Icons Battery Service Accessibility Manager DiskStats Service Lights Service Mount Service ADB Settings Observer Vibrator Service Notification Manager Alarm Manager Device Storage Monitor Init Watchdog Location Manager Sensor Service Search Service Window Manager DropBox Service Bluetooth Service Wallpaper Service 39
  • 40. 40
  • 41. 11. Calling on System Services ● Use getSystemService ● Ex: NotificationManager Object reference: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); ● Prepare your content ● Call on the object: mNotificationManager.notify(HELLO_ID, notification); 41
  • 42. 12. ActivityManager ● Start new Activities, Services ● Fetch Content Providers ● Intent broadcasting ● OOM adj. maintenance ● Application Not Responding ● Permissions ● Task management ● Lifecycle management 42
  • 43. Ex. starting new app from Launcher: ● onClick(Launcher) ● startActivity(Activity.java) ● <Binder> ● ActivityManagerService ● startViaZygote(Process.java) ● <Socket> ● Zygote 43
  • 44. 13. Binder ● CORBA/COM-like IPC ● Data sent through “parcels” in “transactions” ● Kernel-supported mechanism ● /dev/binder ● Check /proc/binder/* ● android.* API connected to System Server through binder. 44
  • 45. 45
  • 46. 14. Hardware Abstraction Layer /frameworks/base/core/... /frameworks/base/services/java/... AOSP-provided ASL /frameworks/base/services/jni/ /hardware/libhardware/ /device/[MANUF.]/[DEVICE] Manuf.-provided /sdk/emulator/ Manuf. license Kernel or module Manuf.-provided GPL-license 46
  • 47. 15. Stock AOSP Apps /packages/apps /packages/providers /packages/inputmethods AccountsAndSettings Launcher2 ApplicationProvider LatinIME AlarmClock Mms CalendarProvider OpenWnn Bluetooth Music ContactsProvider PinyinIME Browser PackageInstaller DownloadProvider Calculator Protips DrmProvider Calendar Provision GoogleContactsProvider Camera QuickSearchBox MediaProvider CertInstaller Settings TelephonyProvider Contacts SoundRecorder UserDictionaryProvider DeskClock SpeechRecorder Email Stk Gallery VoiceDialer HTMLViewer 47
  • 48. 16. Case-in-point: Display Architecture ● Display Hardware ● Classic Linux display stack ● Display stack in Android 48
  • 49. 16.1. Display Hardware MMU IOMMU 49
  • 50. 16.2. Classic Linux display stack 50
  • 51. 16.3. Display stack in Android 51
  • 52. 52