1 / 34

Lecturer: Prof.Luqun Li ( liluqun@gmail )

Chapter.1 Introducing the Android Computing Platform. Lecturer: Prof.Luqun Li ( liluqun@gmail.com ) Teaching Assistants: Fengyou Sun, Haijun Yang, Ting Sun. 1. What is Android ?. 2. Brief History - Android. 3. Delving into the Dalvik VM. 4. Summary. Contents. What is Android ?.

joy
Download Presentation

Lecturer: Prof.Luqun Li ( liluqun@gmail )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter.1 Introducing the Android Computing Platform Lecturer: Prof.Luqun Li (liluqun@gmail.com) Teaching Assistants: Fengyou Sun, Haijun Yang, Ting Sun

  2. 1 What is Android? 2 Brief History - Android 3 Delving into the Dalvik VM 4 Summary Contents

  3. What is Android? • An Open Handset Alliance Project • An Open Source Mobile Phone OS • Released by Google

  4. What is Android? • A software stack for mobile devices that includes • An operating system • Middleware • Key Applications • Uses Linux to provide core system services • Security • Memory management • Process management • Power management • Hardware drivers

  5. Mobile Devices: Advantages Always with the user Typically have Internet access Typically GPS enabled Typically have accelerometer & compass Most have cameras & microphones Many apps are free or low-cost

  6. Mobile Devices: Disadvantages Limited screen size Limited battery life Limited processor speed Limited and sometimes slow network access Limited or awkward input: soft keyboard, phone keypad, touch screen, or stylus Limited web browser functionality Range of platforms & configurations across devices

  7. Mobile Applications • What are they? • Any application that runs on a mobile device • Types • Web apps: run in a web browser • HTML, JavaScript, Flash, server-side components, etc. • Native: compiled binaries for the device • Often make use of web services

  8. 1 What is Android? 2 Brief History - Android 3 Delving into the Dalvik VM 4 Summary Contents

  9. Brief History - Android • 2005 • Google acquires startup Android Inc. to start Android platform • Work on Dalvik VM begins • 2007 • Open Handset Alliance announced • Early look at SDK • 2008 • Google sponsors 1st  Android Developer Challenge • T-Mobile G1 announced

  10. Brief History cont. • 2009 • SDK 1.5 (Cupcake) • New soft keyboard with “autocomplete” feature • SDK 1.6 (Donut) • Support Wide VGA • SDK 2.0/2.0.1/2.1 (Eclair) • Revamped UI, browser • 2010 • Nexus One released to the public • SDK 2.2 (Froyo) • Flash support, tethering • SDK 2.3 (Gingerbread) • UI update, system-wide copy-paste

  11. 1 What is Android? 2 Brief History - Android 3 Delving into the Dalvik VM 4 Summary Contents

  12. Delving into the Dalvik VM • Google has spent a lot of time thinking about optimizing designs for low-powered handheld devices. • Handheld devices lag behind their desktop counterparts in memory and speed by eight to ten years. • They also have limited power for computation; a handheld device’s total RAM might be as little as 64MB, and its available space for applications might be as little as 20MB.

  13. Delving into the Dalvik VM • First, the Dalvik VM takes the generated Java class files and combines them into one or more Dalvik Executable (.dex) files. • It reuses duplicate information from multiple class files, effectively reducing the space requirement (uncompressed) by half from a traditional .jar file.

  14. Delving into the Dalvik VM • Second, Google has fine-tuned the garbage collection in the Dalvik VM, but it has chosen to omit a just-in-time (JIT) compiler, in this release at least. • The company can justify this choice because many of Android’s core libraries, including the graphics libraries, are implemented in C and C++.

  15. Delving into the Dalvik VM • Finally, the Dalvik VM uses a different kind of assembly-code generation, in which it uses registers as the primary units of data storage instead of the stack. • Google is hoping to accomplish 30 percent fewer instructions as a result.

  16. Understanding the Android Software Stack • 用汉堡比喻Android 平台架构 Android Architecture

  17. 用汉堡比喻Android 平台架构

  18. Architecture Phone Users App Developers Programmers Hardware Developers

  19. Linux Kernel • Works as a HAL (Hardware Abstraction Layer) • Device drivers • Memory management • Process management • Networking

  20. Libraries • C/C++ libraries • Interface through Java (J2SE and not J2ME) • Surface manager – Handling UI Windows • 2D and 3D graphics • Media codecs, SQLite, Browser engine

  21. Runtime • Dalvik VM • Dex files • Compact and efficient than class files • Limited memory and battery power • Core Libraries • Java 5 Std edition • Collections, I/O etc…

  22. Application Framework • API interface • Activity manager – manages application life cycle.

  23. Applications • Built in and user apps • Can replace built in apps

  24. Developing an End-User Application with the Android SDK • You must know the concepts of: • Activity • Service • Boardcast Receiver • Content Provider

  25. Application Building Blocks • Activity • Visible screen for user interaction • Services • Background services that tend to persist for a long time • Broadcast Receivers • Similar to interrupt handlers • Content Providers • Persistent data

  26. Activities • Typically present a visual interface to the user • Owns a view that controls a rectangular window.But, they can: • Be faceless • Be in a floating window • Return a value • Supports child view derived from parents • Maintains a history stack of all activities that are spawned in an application Eg: The “Calculator” app may have an activity that displays a numeric keyboard and buttons for numeric operations, etc. and awaits inputs from the user.

  27. Android API – activity control loop • 3 States essentially (see the colored ovals) • Active or running • Paused • Stopped • Call backs during state transition (see rectangles)

  28. Services • Faceless components that run in the background • E.g. A common example of a service is an mp3 player that may run in the background as the user may be involved with some activity of another app, e.g. web browser, network download etc…

  29. Services control loop • Used in 2 ways • Created by an activity and left running. • Expose interfaces operated programmatically

  30. Broadcast Receivers • Broadcast receivers are similar to interrupt handlers in normal OS. BRs run in the background, listening for interrupts generated by other apps • An application may have one or more BR’s to handle interrupts. • Examples of interrupts: • Incoming phone call • User changed language setting • Battery is low • User has transited from one time zone to different one

  31. Content Providers • Content providers make some subset of an application’s data available to other apps when requested E.g. address book, photo gallery • Content providers are the only mechanism for apps to share data across; there's no common storage area that all Android packages can access. • Ships with common data types (audio, video, images, personal contact information, and so on)

  32. 1 What is Android? 2 Brief History - Android 3 Delving into the Dalvik VM 4 Summary Contents

  33. Summary • In this chapter, we wanted to pique your curiosity about Android. • You saw how handhelds are becoming general-purpose computing devices, and you got an overview of the Dalvik VM, which makes it possible to run a complex framework on a constrained handset. • You explored Android’s software stack and got a taste of its programming concepts.

  34. Homework • Browse www.android.com. • Download android SDK ,eclips,ADT,Java, Motodev Studio for later use. • Compare anroid with Jave ME • Try some android mobile phone

More Related