• Save
Introduction To Android 4.x
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Introduction To Android 4.x

on

  • 183 views

A gentle introduction to the Android 4.x platform

A gentle introduction to the Android 4.x platform

The source code is available at https://github.com/iliocatallo/takenotes

Statistics

Views

Total Views
183
Views on SlideShare
167
Embed Views
16

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 16

http://ease-the-computation.haunted.io 16

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction To Android 4.x Presentation Transcript

  • 1. Introduction to Android 4.x Ilio Catallo, Eleonora Ciceri – Politecnico di Milano ilio.catallo@polimi.it, eleonora.ciceri@polimi.it
  • 2. What is Android? ¤  Android is an open-source software stack that includes the operating system, middleware and built-in mobile applications ¤  Based on a modified version of Linux ¤  The full source code can be downloaded ¤  Vendors add their own proprietary extensions to differentiate their products from others ¤  Example: most Samsung’s terminals are shipped with a custom user interface called TouchWiz 2
  • 3. Mobile development in a nutshell 2001 20092007 Prehistory Developers code in low- level languages (e.g., C++) and need to understand the specific HW they are coding for Middle age Symbian provides proprietary APIs that encourage the development of rich mobile apps •  Difficult to work with different HW implementations (e.g., GPS) •  Java code can be executed in a JME, at the price of restricted access to the HW Renaissance iPhone and Windows Phone provide a richer development environment for mobile applications •  Built on a proprietary operating system •  Explicit application approval mechanism Modern time Android offers a unified approach to application development meant to operate on any compatible device 3
  • 4. AndroidArchitecture 16 x CHAPTER 1 HELLO, ANDROID Application Layer Application Framework Native Apps (Contacts, Maps, Browser, etc.) Graphics (OpenGL, SGL, FreeType) Third-Party Apps Location-Based Services Telephony Bluetooth / NFC / Wi-Fi Direct Notifications Media libc SSL & Webkit Android Libraries Android Run Time SQLite Views Resource Manager Surface Manager Dalvik Virtual Machine Memory Management Process Management Power Management Hardware Drivers (USB, Display, Bluetooth, etc.) Content Providers Window Manager Activity Manager Package Manager Developer Apps Libraries Linux Kernel FIGURE 1-1 The Dalvik Virtual Machine 4
  • 5. Android architecture: Kernel ¤  The Linux kernel handles low-level hardware interactions, including drivers and memory management ¤  The Android kernel is actually a branch of the standard Linux kernel ¤  Several features have been added or modified to tackle the mobile usage scenario ¤  The most significant feature is a custom power management solution (i.e., wakelocks) designed so that the default state of the device is sleep Meier c01.indd V1 - 11/24/2011 Page 16 16 x CHAPTER 1 HELLO, ANDROID Application Layer Application Framework Native Apps (Contacts, Maps, Browser, etc.) Graphics (OpenGL, SGL, FreeType) Third-Party Apps Location-Based Services Telephony Bluetooth / NFC / Wi-Fi Direct Notifications Media libc SSL & Webkit Android Libraries Android Run Time SQLite Views Resource Manager Surface Manager Dalvik Virtual Machine Memory Management Process Management Power Management Hardware Drivers (USB, Display, Bluetooth, etc.) Content Providers Window Manager Activity Manager Package Manager Developer Apps Libraries Linux Kernel FIGURE 1-1 The Dalvik Virtual Machine One of the key elements of Android is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run effi- ciently on a single device. The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, includ- ing security, threading, and process and memory management. It’s also possible to write C/C++ applications that run closer to the underlying Linux OS. Although you can do this, in most cases there’s no reason you should need to. If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. c01.indd 16c01.indd 16 4/11/2012 10:03:274/11/2012 10:03:27 www.it-ebooks.info 5
  • 6. Android architecture: Android Run Time ¤  Android applications are: ¤  written in Java as the programming language ¤  executed by means of a custom virtual machine (VM) named Dalvik (every app runs in its own Dalvik instance) ¤  Dalvik’s Pros ¤  Dalvik creates an abstraction layer that ensures developers not to worry about a specific HW implementation ¤  Dalvik is designed so that multiple instances run efficiently on a single mobile device Meier c01.indd V1 - 11/24/2011 Page 16 16 x CHAPTER 1 HELLO, ANDROID Application Layer Application Framework Native Apps (Contacts, Maps, Browser, etc.) Graphics (OpenGL, SGL, FreeType) Third-Party Apps Location-Based Services Telephony Bluetooth / NFC / Wi-Fi Direct Notifications Media libc SSL & Webkit Android Libraries Android Run Time SQLite Views Resource Manager Surface Manager Dalvik Virtual Machine Memory Management Process Management Power Management Hardware Drivers (USB, Display, Bluetooth, etc.) Content Providers Window Manager Activity Manager Package Manager Developer Apps Libraries Linux Kernel FIGURE 1-1 The Dalvik Virtual Machine One of the key elements of Android is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run effi- ciently on a single device. The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, includ- ing security, threading, and process and memory management. It’s also possible to write C/C++ applications that run closer to the underlying Linux OS. Although you can do this, in most cases there’s no reason you should need to. If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. c01.indd 16c01.indd 16 4/11/2012 10:03:274/11/2012 10:03:27 www.it-ebooks.info 6
  • 7. Android architecture: Core Libraries ¤  The core Android libraries provide most of the JSE environment ¤  Example: java.util.*! ¤  Further libraries are added to the Java standard libraries to provide specific functionalities ¤  Example: user interface framework 7 Meier c01.indd V1 - 11/24/2011 Page 16 16 x CHAPTER 1 HELLO, ANDROID Application Layer Application Framework Native Apps (Contacts, Maps, Browser, etc.) Graphics (OpenGL, SGL, FreeType) Third-Party Apps Location-Based Services Telephony Bluetooth / NFC / Wi-Fi Direct Notifications Media libc SSL & Webkit Android Libraries Android Run Time SQLite Views Resource Manager Surface Manager Dalvik Virtual Machine Memory Management Process Management Power Management Hardware Drivers (USB, Display, Bluetooth, etc.) Content Providers Window Manager Activity Manager Package Manager Developer Apps Libraries Linux Kernel FIGURE 1-1 The Dalvik Virtual Machine One of the key elements of Android is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run effi- ciently on a single device. The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, includ- ing security, threading, and process and memory management. It’s also possible to write C/C++ applications that run closer to the underlying Linux OS. Although you can do this, in most cases there’s no reason you should need to. If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. c01.indd 16c01.indd 16 4/11/2012 10:03:274/11/2012 10:03:27 www.it-ebooks.info
  • 8. Android architecture: Libraries ¤  The libraries contain all the code (C/C++ libraries) that provides the main features of the Android OS ¤  Examples: WebKit, SSL, OpenGL ¤  The libraries are all internal implementations of Android ¤  They are not directly exposed to the published Android API ¤  The application framework layer accesses these libraries through the Dalvik VM Meier c01.indd V1 - 11/24/2011 Page 16 16 x CHAPTER 1 HELLO, ANDROID Application Layer Application Framework Native Apps (Contacts, Maps, Browser, etc.) Graphics (OpenGL, SGL, FreeType) Third-Party Apps Location-Based Services Telephony Bluetooth / NFC / Wi-Fi Direct Notifications Media libc SSL & Webkit Android Libraries Android Run Time SQLite Views Resource Manager Surface Manager Dalvik Virtual Machine Memory Management Process Management Power Management Hardware Drivers (USB, Display, Bluetooth, etc.) Content Providers Window Manager Activity Manager Package Manager Developer Apps Libraries Linux Kernel FIGURE 1-1 The Dalvik Virtual Machine One of the key elements of Android is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run effi- ciently on a single device. The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, includ- ing security, threading, and process and memory management. It’s also possible to write C/C++ applications that run closer to the underlying Linux OS. Although you can do this, in most cases there’s no reason you should need to. If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. c01.indd 16c01.indd 16 4/11/2012 10:03:274/11/2012 10:03:27 www.it-ebooks.info 8
  • 9. Android architecture: Application Framework ¤  The application framework exposes the Android capabilities that developers can use in their applications ¤  Examples: window manager, location manager, databases, telephony, sensors ¤  The application framework defines the set of APIs made available by the Android OS Meier c01.indd V1 - 11/24/2011 Page 16 16 x CHAPTER 1 HELLO, ANDROID Application Layer Application Framework Native Apps (Contacts, Maps, Browser, etc.) Graphics (OpenGL, SGL, FreeType) Third-Party Apps Location-Based Services Telephony Bluetooth / NFC / Wi-Fi Direct Notifications Media libc SSL & Webkit Android Libraries Android Run Time SQLite Views Resource Manager Surface Manager Dalvik Virtual Machine Memory Management Process Management Power Management Hardware Drivers (USB, Display, Bluetooth, etc.) Content Providers Window Manager Activity Manager Package Manager Developer Apps Libraries Linux Kernel FIGURE 1-1 The Dalvik Virtual Machine One of the key elements of Android is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run effi- ciently on a single device. The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, includ- ing security, threading, and process and memory management. It’s also possible to write C/C++ applications that run closer to the underlying Linux OS. Although you can do this, in most cases there’s no reason you should need to. If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. c01.indd 16c01.indd 16 4/11/2012 10:03:274/11/2012 10:03:27 www.it-ebooks.info 9
  • 10. Android architecture: Application ¤  This layer comprises the applications that ship with the Android devices ¤  Examples: SMS application, music player ¤  Moreover, in many cases Android devices also ship with some proprietary Google mobile apps ¤  Examples: Google Play Store, Gmail email client Meier c01.indd V1 - 11/24/2011 Page 16 16 x CHAPTER 1 HELLO, ANDROID Application Layer Application Framework Native Apps (Contacts, Maps, Browser, etc.) Graphics (OpenGL, SGL, FreeType) Third-Party Apps Location-Based Services Telephony Bluetooth / NFC / Wi-Fi Direct Notifications Media libc SSL & Webkit Android Libraries Android Run Time SQLite Views Resource Manager Surface Manager Dalvik Virtual Machine Memory Management Process Management Power Management Hardware Drivers (USB, Display, Bluetooth, etc.) Content Providers Window Manager Activity Manager Package Manager Developer Apps Libraries Linux Kernel FIGURE 1-1 The Dalvik Virtual Machine One of the key elements of Android is the Dalvik VM. Rather than using a traditional Java VM such as Java ME, Android uses its own custom VM designed to ensure that multiple instances run effi- ciently on a single device. The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality, includ- ing security, threading, and process and memory management. It’s also possible to write C/C++ applications that run closer to the underlying Linux OS. Although you can do this, in most cases there’s no reason you should need to. If the speed and efficiency of C/C++ is required for your application, Android provides a native development kit (NDK). The NDK is designed to enable you to create C++ libraries using the libc and libm libraries, along with native access to OpenGL. c01.indd 16c01.indd 16 4/11/2012 10:03:274/11/2012 10:03:27 www.it-ebooks.info 10