Intro/Overview - History Android Inc. founded 2003 Purchased by Google from initial dveloper in 2005 Version 2.0 released 2009 o Starts to take hold in the Smartphone Market Version 3.0 released 2011 o Predominantly used in Tablets
Intro/Overview - Features Apps o The "Programs" of Android o Composed of application components Widgets o Provide information and tools directly on the Home Screen o No need to launch an activity Marketplace o A place for App distribution, run by Google o Developers can sell their apps or give them away freely o Third Party distributors also available
Late 2009/Early 2010 Android begins it's growth in the US Smartphone market As of Janurary 2011 the Android OS has the highest marketshare in smartphones in the US Now more prevalent than iOS (Apple) and Blackberry (RIM)
Intro/Overview - Relevant Devices Phones: HTC Thunderbolt Motorola Droid/2/X HTC Evo Samsung Nexus S +Many More Tablets: Motorola Xoom Samsung Galaxy Tab 4G Dell Streak Asus Eee-Pad Transformer +More
Device Requirements Chipset: ARM-based (32-bit Advanced reduced instruction set computer architecture machine). Dalvik VM graphics processing, currently assume an ARM architecture. Memory: 128 MB RAM; 256 MB Flash External. Android can boot and run in configurations with less memory, but it isn't recommended. Storage: Mini or Micro SD. Not necessary for basic bring up, but recommended. Primary Display: QVGA (320×240) TFT LCD or larger, 16-bit color or better. Touch screen interface no smaller than 2.8 inches in size. Navigation Keys: 5-way navigation with 5 application keys, power, camera and volume controls. Camera: Must have a resolution of at least 2 megapixels, but not required. USB: Standard mini-B USB. For flashing the device system images and debugging. Bluetooth: 1.2 or 2.0, but not required.
About the Android Kernel Derived from the Linux 2.6 kernel, with added enhancements not found in Linux Kernel mode and user mode are used the same as in the Linux kernel
Ashmem Anonymous Shared Memory Ashmem uses virtual memory The kernel is allowed to free this shared memory More viable for low memory devices, because it can discard shared memory units
Pmem Process memory allocator Similar to ashmem, but uses physically contiguous memory as opposed to virtual memory Manages large, contiguous regions of memory shared between user space and the kernel drivers
Binder A tool for inter-process communication Binder driver manages synchronization between processes Facilitated using different states o Receive blocked o Ready o Send blocked o Reply blocked
Logger System logging, separate from the Linux kernel’s own logging system Stores logs from applications, events, and the system Write path is optimized to avoid overhead from open(), write(), and close()
Android Power Management Wake locks are used to hold the machine awake until a wake lock is released Wake locks issued in user space, handled by kernel Power management can shut CPU down if there are no active wake locks
Multithreading and Multitasking Expensive operations are done in a background service Slow work is done in a background thread Ensure the UI is responsive to the user Processes are not killed when the user closes an application, instead they remain in the background
Removal From Linux Kernel Android code removed from Linux kernel as of December, 2009 Kernel development has been removed from the Linux kernel tree Android kernel includes features that would need to be integrated into Linux kernel to merge it into main kernel tree
System Libraries libc for C and C++ o Why not glibc? libpthread o not 100% POSIX compliant Isn't Android programmed in Java? SDK vs NDK
More Libraries SSL SQLite WebKit (and LibWebCore for embeddable webpages) Audio Manager Media Framework o MediaPlayer
Graphics Libraries Scalable Graphics Library (SGL- for 2D) OpenGL for Embedded Devices (for 3D) FreeType (vector and bitmap fonts) Surface Manager o Composes 2D and 3D windows, widgets, apps, toolbars and more using Surface Flinger o Uses Binder IPC to get buffers from apps to put into frames
Hardware Abstraction Libraries GPS, Radio, Camera, Bluetooth, other I/O Hardware drivers must implement in order for applicationss to use them Applications interact with the abstraction libraries, not the driver Promotes variety in hardware without breaking applications Gives OS tighter control over devices
Android vs Linux Software Architecture No native window library Does not support full set of GNU libraries Difficult to port Linux applications to Android, but possible if working within libc constraints
Reboot Bug (2008) Android allowed a remote device to be controlled over serial port If device not attached, phone would execute ALL text input as shell commands Typing “reboot” in an email/browser/anywhere would result in phone rebooting Architecture and Components at fault! Promptly fixed, but jeopardized Android’s reputation.
Application Development Most Android applications written in Java However, no Java Virtual Machine in the platform Java classes compiled into Dalvik virtual machine Dalvik - a specialized virtual machine designed specifically for Android
Android Software Development Kit (SDK) The SDK includes a comprehensive set of development tools. Includes a debugger, libraries, documentation, sample code These tools are accessed through an Eclipse plugin called ADT (Android Development Tools) or from command line Developing with Eclipse is preferred (but not required)
Steps for Developing Applications 1. Install Eclipse or own IDE 2. Install ADT plugin, or an editor of your choice 3. Set up Android Virtual Devices or hardware devices on which you will install your applications 4. Create an Android project o Contains all source code and resource files for your application. Built into an.apk package that you can install on Android devices. 5. Build and run your application
Steps for Developing Applications 6. Debug your application with the SDK debugging tools o Involves using a JDWP-compliant debugger along with the tools provided with Android SDK. 7. Test your application with the Testing and Instrumentation framework o The Android SDK provides a testing and instrumentation framework to help set up and run tests
Support for Additional Languages In 2009, Google announced the Android Native Development Kit (NDK) o Allows developers to build Android software components with C and C++ o Comes with limitations, however o Intended to be used alongside Java to code individual parts of programs, not as a full alternative Google also launched the Android Scripting Environment (ASE) - allows developers to build apps with Python and Lua
New Language July, 2009, Google released language called Simple, designed specifically for Android apps Simple - based on BASIC Easy to learn and use language Gives both amateur and professional programmers a quick and easy way to write Android apps
Android Components Four types: Activities - Services - Content Providers - Broadcast Receivers Part of the building blocks of applications Each component type performs its own unique action
Component - Activity Activities can be thought of as a single view that provides a user interface Each activity is it's own entity but all activities work together to form the application.
Component - Services Services are tasks that run in the background Run on the main process thread unless otherwise specified Examples include playing music while using other applications, handling network transactions, etc (Image from http://marakana.com)
Component - Content Provider Content Providers allow for cross application communication Applications must have necessary permission levels to communicate For example allows applications to select an image from the phones library, select a contacts info from the contacts list, etc
Component - Broadcast Receiver Broadcast are system wide notifications Broadcast Receivers allow applications to receive those notifications and act accordingly For example releasing allocation memory on a low memory warning.
Growth Android predicted to grow in market share: o 38.6% (#2) tablet OSes by 2015 o 48.8% (#1) phone OSes by 2015
Reasons for Growth Open Source o Many handset / tablet makers utilize this free OS (HTC, Motorola, Samsung) Saturates the market with Android hardware on multiple carriers o Free to develop on -- no overhead charge for developing apps (iOS) Strong fan base Alternative to iOS-based devices It's Google
With Great Growth Comes Great Responsibility Fragmentation Different screen sizes, hardware features, user interfaces and carrier-decided OS updates cause inconsistent Android experience After selling a device, manufacturer has little incentive to offer updates Security More users = more attractive to malware writers "Open" market means it's customer's responsibility to stay away from malicious software Smartphone use in business world poses risk
Merger With Chrome OS Eric Schmidt (ex-CEO): o The two efforts [Android and Chrome OS] will ultimately converge. o "We're working overtime to get these technologies merged in the right way." What does this mean for Android?
Merger With Chrome OS Chrome OS heavily utilizes the cloud. o A small hard drive is only needed for the OS itself. The merger may bring more cloud services to Android, possibly eliminating the need for internal storage. o Pictures, songs, videos, etc. may not need to be stored on the devices themselves -- instead pulled from the cloud when requested.