android michaelmorckos may 13 09

Upload: recursive-enumerable

Post on 06-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Android Michaelmorckos May 13 09

    1/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    Android Architecture

    Michael Y. Morckos

    German Univeristy in Cairo

    May 13, 2009

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    2/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    What is Android

    Android is an operating system for mobile devices Its an integrated open source software stack for mobile device

    Operating system Middleware Key mobile applications

    Went open source in late 2008. Released under the Apache v2license

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    3/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    History

    Google acquired Android Inc. in July 2005

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    4/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    History

    Google acquired Android Inc. in July 2005

    The Android team, led by Andy Rubin, developed a mobiledevice platform powered by Linux operating system

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    5/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    History

    Google acquired Android Inc. in July 2005

    The Android team, led by Andy Rubin, developed a mobiledevice platform powered by Linux operating system

    This signaled Googles entry into the mobile-phone market

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    6/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    Open Handset Alliance

    A consortium established by Google in November 2007

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    7/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    Open Handset Alliance

    A consortium established by Google in November 2007

    34 members including key companies in mobile handsets,application developments and mobile chips industries.

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    8/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    Open Handset Alliance

    A consortium established by Google in November 2007

    34 members including key companies in mobile handsets,application developments and mobile chips industries.

    The consortium aim at providing open standards for mobiledevices for richer capabilities and reduced cost

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    9/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    Open Handset Alliance

    A consortium established by Google in November 2007

    34 members including key companies in mobile handsets,application developments and mobile chips industries.

    The consortium aim at providing open standards for mobiledevices for richer capabilities and reduced cost

    On the same month Android was unveilled, marking it theflagship product of the OHA consortium

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    10/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    Open Handset Alliance

    A consortium established by Google in November 2007

    34 members including key companies in mobile handsets,application developments and mobile chips industries.

    The consortium aim at providing open standards for mobiledevices for richer capabilities and reduced cost

    On the same month Android was unveilled, marking it theflagship product of the OHA consortium

    The T-Mobile G1 (HTC Dream) was the first mobile devicepowered by Android. Released on October 2008

    Michael Y. Morckos Android Architecture

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    11/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    What is Android

    Innovative Features

    Linux kernel

    Open system Component based

    Java programming language for applications development

    Enable mobile applications to exploit full advantage of all a

    handset has to offer No boundaries

    Fast & easy development

    Michael Y. Morckos Android Architecture

    Contents

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    12/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Contents

    Overview Linux Kernel

    Android Runtime

    Android Native Libraries

    Application Framework Applications

    Michael Y. Morckos Android Architecture

    Contents

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    13/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Android Stack

    Michael Y. Morckos Android Architecture

    Contents

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    14/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Android Architecture

    Michael Y. Morckos Android Architecture

    I d iContentsO i

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    15/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Kernel

    Michael Y. Morckos Android Architecture

    I t d tiContentsO i

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    16/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Overview

    Android uses a heavily modified GNU/Linux kernel version 2.6for handling core system infrastructure services as security,memory management, process management, network stack,and driver model

    The kernel provides an abstraction layer between the hardware

    and the rest of the software stack Include many enhancements and modifications

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    17/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Android Power Management

    A light-weight power managemenr driver built atop thestandard linux power management Constrainted power management policy

    CPU shouldnt consume power if no applications or servicesrequire power

    Components make requests to keep the power on throughWake Locks

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    18/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Binder

    An OpenBinder-based driver to facilitate inter-processcommunication (IPC) on the Android platform

    OpenBinder provides: High performance through shared memory Per-process thread pool for processing requests Synchronous calls between processes

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    19/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Memory Management

    Low Memory Killer: based on feedbacks from user

    applications, the low memory killer can kill processes to freeup memory as necessary

    Provides more flexibility than the Out Of Memory (OOM)killer in the standard kernel

    Android PMEM: the PMEM (physical memory) driver is usedto provide contiguous physical memory regions to userspacelibraries that interact with the processor and other hardware

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    20/78

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    OverviewLinux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Other Components

    Logger: A light weight logging device used to capture system,radio, logdata, etc.

    Android Alarm: A driver which provides timers that can wakethe device up from sleep and a monotonic timebase that runswhile the device is asleep

    M-Systems: for memory cards and other flash media storage

    Other conventional drivers: Bluetooth Display Keypad Audio ...

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    21/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Runtime

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    22/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Overview

    A vital component in the Android stack

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    23/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Overview

    A vital component in the Android stack Composed of two major parts:

    The Dalvik virtual machine Core libraries

    Michael Y. Morckos Android Architecture

    IntroductionContentsOverview

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    24/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Dalvik Virual Machine

    One of the most important components in Android

    Michael Y. Morckos Android Architecture

    IntroductionA d id A hi

    ContentsOverviewLi K l

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    25/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Dalvik Virual Machine

    One of the most important components in Android

    Developed by Dan Bornstein, and named after the Dalvikvillage in Iceland

    Michael Y. Morckos Android Architecture

    IntroductionA d id A hit t

    ContentsOverviewLi K l

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    26/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    Dalvik Virual Machine

    One of the most important components in Android

    Developed by Dan Bornstein, and named after the Dalvikvillage in Iceland

    Three main design targets: runs on a limited CPU and RAM (250-500MHz) (20-40 MB)

    runs atop an OS with no swap space runs on a device with limited power

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    ContentsOverviewLinux Kernel

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    27/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    From .class to .dex

    Dalvik replaces the JVM in providing the runtime environmentto Java platform applications

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    ContentsOverviewLinux Kernel

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    28/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    From .class to .dex

    Dalvik replaces the JVM in providing the runtime environmentto Java platform applications

    The VM runs Java applications which have been converted tothe Dalvik Executable format .dex

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    ContentsOverviewLinux Kernel

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    29/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    From .class to .dex

    Dalvik replaces the JVM in providing the runtime environmentto Java platform applications

    The VM runs Java applications which have been converted tothe Dalvik Executable format .dex

    The dx tool available in the SDK converts Java bytcode toDVM bytcode at build time

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    ContentsOverviewLinux Kernel

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    30/78

    Android ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    Linux KernelAndroid RuntimeNative LibrariesApplication FrameworkApplications

    From .class to .dex

    Dalvik replaces the JVM in providing the runtime environmentto Java platform applications

    The VM runs Java applications which have been converted tothe Dalvik Executable format .dex

    The dx tool available in the SDK converts Java bytcode toDVM bytcode at build time

    The dx format is a highly efficient and compact bytecode

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    ContentsOverviewLinux Kernel

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    31/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    From .class to .dex

    Dalvik replaces the JVM in providing the runtime environmentto Java platform applications

    The VM runs Java applications which have been converted tothe Dalvik Executable format .dex

    The dx tool available in the SDK converts Java bytcode toDVM bytcode at build time

    The dx format is a highly efficient and compact bytecode dx files can be installed on different devices and can be

    further modified after being installed to increase efficiency

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    ContentsOverviewLinux Kernel

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    32/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    Dalvik Features

    Highly CPU optimized interpreter No just-in-time compiling

    Shared constants pool and data structures

    Static linking

    Bytes reordering

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    ContentsOverviewLinux Kernel

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    33/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    Core Libraries

    Androids core libraries provide most of the functionalityavailable in the core libraries of Java needed for applicationsdevelopment: I/O functionalities Collections File access ...

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    A d id A li i F d l

    ContentsOverviewLinux KernelA d id R i

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    34/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    Native Libraries

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    A d id A li ti F d t l

    ContentsOverviewLinux KernelA d id R ti

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    35/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    Overview

    This layer houses the core libraries providing the bulk ofAndroid functionalities

    Implemented in C/C++

    Developers can exploit the full capabilities of these libs

    through the application framework layer

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    36/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    Bionic (libC)

    A BSD-based implementation of the standard C library, tuned

    for embedded Linux-based devices 200 KB in size, roughly half the size of the standard GNU C

    library libc

    Bionic includes a very fast and small custom POSIX-thread

    implementation Compatability issue with GNU libc

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    37/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    SQLite

    A powerful lightweight embedded relational databasemanagement system contained in a relatively small ( 500 kb)

    C library The engine is not a standalone entity. Instead, a SQLite

    database is just another program linked in and thus becomesan integral part of the program

    The database is stored as a single cross-platform file on thehost machine

    Application access SQLite through conventional simplefunction calls

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    38/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    Surface Manager

    Responsible for composing different drawing surfaces on the

    mobile screen Manages access for different processes to the underlying

    display subsystem and composites 2D and 3D graphic layersfrom multiple applications

    Layers passed as buffers via Binder IPC calls

    Use OpenGL/ES and 2D hardware accelerator for itscompositions

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    39/78

    Android Application FundamentalsAndroid SDK

    Summary

    Android RuntimeNative LibrariesApplication FrameworkApplications

    OpenGL/ES & SGL

    Subset of the OpenGL 3D graphics API designed for

    embedded devices Defined and promoted by the Khronos Group, a graphics

    hardware and software industry consortium

    Can use either hardware 3D acceleration (hardwaredependent) or the included highly optimized 3D softwarerasterize

    SGL is Androids specialized 2D graphics library

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    40/78

    ndroid pplication FundamentalsAndroid SDK

    Summary

    ndroid RuntimeNative LibrariesApplication FrameworkApplications

    Media Framework

    Provided by PacketVideos multimedia package OpenCore

    The OpenCore provides a universal structure for mobilemultimedia applications

    Support for standard video, audio, still-frame formats(MPEG4, MP3, AAC, AMR, JPG, and PNG, H.264)

    Support for codec plug-ins

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    41/78

    ppAndroid SDK

    SummaryNative LibrariesApplication FrameworkApplications

    FreeType

    Implements a font rasterization engine

    Written in C

    It is used to rasterize characters into bitmaps and providessupport for other font-related operations

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    42/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    LibWebCore (WebKit)

    A framework providing the basis for building a web browserbased on the open source WebKit browser

    Written in C++

    Rendering of pages in full (desktop) view

    Support for modern web technologies; CSS, JavaScript, DOM,AJAX

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application Fundamentals

    ContentsOverviewLinux KernelAndroid Runtime

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    43/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    Audio Manager (Audio Flinger)

    Processing multiple audio streams into PCM audio out paths

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsA d id SDK

    ContentsOverviewLinux KernelAndroid RuntimeN i Lib i

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    44/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    Framework Overview

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsA d id SDK

    ContentsOverviewLinux KernelAndroid RuntimeN ti Lib i

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    45/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    Overview

    A general purpose toolkit that all applications use

    Written in Java

    Enable reuse and replacement of components

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    46/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    View System

    Enabling applications to access data from other applicationsor to share their own data

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    47/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    Resource Manager

    Providing access to non-code resources (localized string,graphics, and layout files)

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    48/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    Notification Manager

    Enabling all applications to display customer alerts in thestatus bar

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    49/78

    Android SDKSummary

    Native LibrariesApplication FrameworkApplications

    Activity Manager

    Managing the lifecycle of applications and providing acommon navigation backstack

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    50/78

    Summary Application FrameworkApplications

    Telephony Manager

    Provides core telephoning functionalities

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    51/78

    Summary Application FrameworkApplications

    XMPP Service

    An Open, XML-based protocol originally aimed atnear-real-time, extensible instant messaging

    Largely extended. VoIP Aims to:

    Send simple P2P message between handsets Send and receive IMs using Googles Talk

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    52/78

    Summary Application FrameworkApplications

    Location Manager

    Allows applications to obtain periodic updates devices geographical location triggers an application-specified event when the device enters

    the proximity of a given geographical location

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    ContentsOverviewLinux KernelAndroid RuntimeNative Libraries

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    53/78

    Summary Application FrameworkApplications

    Window Manager

    The window manager creates display surfaces for theapplication

    Responsible for organizing the screen and display of differentlayers of application

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    S

    ContentsOverviewLinux KernelAndroid RuntimeNative LibrariesA li i F k

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    54/78

    Summary Application FrameworkApplications

    Applications

    Android comes with a bundle of core applications:

    email client

    SMS program

    calendar

    maps

    browser

    contacts

    ...

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    S

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksC t Lif l

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    55/78

    Summary Components Lifecycle

    Overview

    Written in Java (as you know)

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    56/78

    Summary Components Lifecycle

    Overview

    Written in Java (as you know) The compiled application is bundled by the aapt tool into an

    Android package .apk

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    57/78

    Summary Components Lifecycle

    Overview

    Written in Java (as you know) The compiled application is bundled by the aapt tool into an

    Android package .apk

    Like .jad & .jar in J2ME, .apk files are distributed andinstalled on Android powered devices

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    58/78

    Summary Components Lifecycle

    Basic Facts

    Every application: is a single Linux process

    has its own VM instance

    is assigned a unique Linux user ID

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    59/78

    Summary Components Lifecycle

    Basic Facts

    A key feature of Android is that applications can publishtheir functionalities

    An application can use other functionalities provided by otherapplications

    Android applications dont have a single entry point

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    60/78

    y p y

    Application Diagram

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    61/78

    y p y

    Activities Class in the API An activity presents the user with a visual UI for a specific

    functionality

    Application can have several activities Each activity is given a default window to draw in The visual content of the window is provided by a hierarchy of

    views User interacts with activities through the views Android provides several built-in views:

    Buttons Menus Text fields ...

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    62/78

    Services

    Background functionalities

    Run in the applicationss thread

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    63/78

    Content Provider

    Provides applications with required applications data Data stored in a SQLite DB

    Applications talk to content provider through a contentresolver

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    64/78

    Broadcast Receiver

    Receive and react to broadcast announcements

    Many originate from system level

    Persistent

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    65/78

    Activation

    Content providers are activated when targeted by applications

    (implicit activation) Broadcast receivers are activated when receiving

    Services and activities are activated by intent msgs

    Intent messages contains ID of component to be activated +

    URI of data to be used Intent filters

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    66/78

    Deactivation

    Content providers and broadcast receivers are shut down oncethey are done

    Activities and services require explicit shutdown

    Components might also be shut down by the system toreclaim memory for higher priority components (life cycle)

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    67/78

    Tasks

    Different activities can be activated on demand

    A group of activities composes a task. They are maintained ina stack

    Users experience of an application can actually be a taskconsisting of different activities from different applications

    Can have a stack of tasks as well

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    68/78

    Activity

    Activities can be in one of these states at an instance:

    Active: has the users focus, displayed in the foreground

    Paused: still visible but under another active activity

    Stopped: completely obscured by another activity, no longervisible

    If an activity is paused or stopped, the system can drop it from

    memory. When the user returns to it, the system must restore it toits previous state

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    69/78

    Activity

    Entire lifetime: from the moment the activity is created tilldestroyed

    Visible lifetime: from the moment the activity activated tillstopped

    Foreground lifetime: between resuming and pausing an activity

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    70/78

    Activity Lifecycle

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    71/78

    Service

    Services can be shutdown explicity or implicitly

    Entire lifetime: from creation till destruction

    Active lifetime: from activation

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    IntroductionApplication ComponentsComponents Activation/DeactivationTasksComponents Lifecycle

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    72/78

    Broadcast Receiver

    Broadcast receiver is active when receiving and reacting to anotification

    A process with an active broadcast receiver is protected frombeing killed

    Active lifetime: from activation

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    73/78

    Overview

    The SDK includes a full set of tools for developing anddebugging application

    Designing UIs Major components in version 1.5:

    Android Development Tools Plugin (for the Eclipse IDE) Android Emulator Android Virtual Devices (AVDs); specifiying different platform,

    hardware options, skins... Dalvik Debug Monitor Service (ddms) Android Asset Packaging Tool (aapt) sqlite3 dx tool

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    74/78

    Standard Procedure: Hello, World

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    75/78

    Summary

    Whats Android Android Architecture

    Android Application Fundamentals

    Android SDK

    Michael Y. Morckos Android Architecture

    IntroductionAndroid Architecture

    Android Application FundamentalsAndroid SDK

    Summary

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    76/78

    Android Closing...

    Questions? Thank you for your attention!

    Michael Y. Morckos Android Architecture

    IntroductionAndroid ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    77/78

    References

    http://developer.android.com/

    http://androidlinux.com/

    http://www.dalvikvm.com/

    http://www.bindaaspoll.com/googleandroid/index.htm

    http://benno.id.au/blog/2007/11/26/what-is-android

    http://it.toolbox.com/wiki/index.php/Dalvik virtual machine

    http://blog.codebeach.com/2007/11/android-architecture-overview.html

    http://stuffthathappens.com/blog/2009/04/12/google-io-2008-dalvik-virtual-machine-internals/

    Michael Y. Morckos Android Architecture

    IntroductionAndroid ArchitectureAndroid Application Fundamentals

    Android SDKSummary

    http://find/http://goback/
  • 8/3/2019 Android Michaelmorckos May 13 09

    78/78

    References

    http://www.kandroid.org/android pdk/intro source code.html

    http://sites.google.com/site/io/dalvik-vm-internals

    http://www.brighthub.com/mobile/google-

    android/articles/17822.aspx http://gfilab.wordpress.com/2008/05/21/android-a-quick-

    overview/

    http://moss.csc.ncsu.edu/ mueller/g1/slides/platform.ppt

    http://www.softdevtube.com/2008/09/16/inside-the-android-application-framework/

    http://groups.google.com/group/android-framework/browse thread/thread/34a635dd68c8b4f4

    Michael Y. Morckos Android Architecture

    http://find/http://goback/