• Aucun résultat trouvé

Android OS

N/A
N/A
Protected

Academic year: 2022

Partager "Android OS"

Copied!
49
0
0

Texte intégral

(1)

Android OS

Google's Mobile Device

Operating System

(2)

Intro & Overview

Steve Mance

(3)

Agenda

• Intro/Overview

• Hardware and IO

• Kernel

• Software Architecture

• Programming Languages

• Application Framework and Components

• Future for mobile and non-mobile platforms

(4)

Intro/Overview - What is Android?

• Operating System optimized for Mobile Devices

• Open Source

• Maintained by Google

• Based on the Linux kernel

(5)

Intro/Overview - System Overview

(6)

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

(7)

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

(8)

Intro/Overview - Marketshare

(9)

Intro/Overview - Marketshare

• 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)

(10)

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

(11)

Hardware and I/O

Dmitiry Lozovatskiy

(12)

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.

(13)

Kernel

Geoff Hetherington

(14)

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

(15)

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

(16)

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

(17)

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

(18)

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()

(19)

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

(20)

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

(21)

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

(22)

Software Architecture

Raanan Korinow

(23)

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

(24)

More Libraries

• SSL

• SQLite

• WebKit (and LibWebCore for embeddable webpages)

• Audio Manager

• Media Framework

o MediaPlayer

(25)

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

(26)

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

(27)

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

(28)

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.

(29)

Programming on Android

Jin Kim

(30)

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

(31)

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)

(32)

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

(33)

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

(34)

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

(35)

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

(36)

Application Components

Jason Loewy

(37)

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

(38)

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.

(39)

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)

(40)

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

(41)

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.

(42)

Android's Future

Adam LaFave

(43)

Growth

Android predicted to grow in market share:

o 38.6% (#2) tablet OSes by 2015

o 48.8% (#1) phone OSes by 2015

(44)

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

(45)

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

(46)

Mobile Growth Visualized

(47)

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?

(48)

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.

(49)

References and Resources

http://elinux.org/Android_Kernel_Features

http://cs736-android.pbworks.com/w/page/5834465/ASHMEM http://elinux.org/Android_Logging_System

http://developer.android.com/index.html

http://developer.android.com/resources/articles/painless-threading.html

http://android-developers.blogspot.com/2010/04/multitasking-android-way.html http://www.kroah.com/log/linux/android-kernel-problems.html

http://www.silicon.com/technology/software/2011/02/16/android-chrome-os-to-converge-says-googles-eric-schmidt-39746988/

http://www.gartner.com/it/page.jsp?id=1626414 http://www.gartner.com/it/page.jsp?id=1622614

http://www.eweek.com/c/a/Mobile-and-Wireless/Androids-Surging-Popularity-10-Factors-Driving-Its-Growth-485860/

http://www.pcworldme.net/2011/02/20/fragmentation-could-stunt-androids-growth/

http://developer.android.com/guide/basics/what-is-android.html

http://arstechnica.com/open-source/news/2009/06/android-goes-beyond-java-gains-native-cc-dev-kit.ars http://www.informationweek.com/news/internet/google/218700186

Références

Documents relatifs

Android platform architecture OS kernel, libraries and devices Android programming model Delvik Virtual Machine?.

Rather, this chapter is designed to point out that the Android Market is maturing very quickly, just like other app markets, and you have to develop a solid marketing strategy

Florida State University College of Law Research Center.. Android Apps

• It is a open source software platform and operating system for mobile devices.. • Based on the

1: The JADE split container mechanism for mobile environments as provided by the LEAP add-on.. called mediator, is in charge of instantiating and maintaining

@Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } @Override public void

The idea on which this paper is based is very simple: exposing the sensors at- tached to an Android Device through a SPARQL endpoint and using SPARQL query federation so that

// la méthode setContentView prend l'objet layout en paramètre // ce paramètre est conservé dans "l'objet layout" de notre instance // les mises à jour sont donc