chapter 1 hello, androidsite.iugaza.edu.ps/wp-content/uploads/ch1 hello, android.pdf · a...

40
Chapter 1 Hello, Android

Upload: others

Post on 09-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Chapter 1 Hello, Android

Page 2: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

OPEN HANDSET ALLIANCE

Page 3: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

OPEN HANDSET ALLIANCE

Page 4: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

A commitment to openness, a shared vision for the future, and

concrete plans to make the vision a reality. To accelerate

innovation in mobile and offer consumers a richer, less expensive,

and better mobile experience.

(http://www.openhandsetalliance.com)

OPEN HANDSET ALLIANCE

Page 5: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Smartphones

Tablets

E-reader devices

Netbooks

MP4 players

Internet TVs

Android Devices in the Market

Page 6: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android Devices

Page 7: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android Devices

For More Pictures onhttps://www.facebook.com/MobileComputingAndroid

Page 8: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Google’s Andy Rubin describes Android as: The first truly open and comprehensive platform for mobile devices, all of the

software to run a mobile phone but without the proprietary obstacles that have

hindered mobile innovation.

(http://googleblog.blogspot.com/2007/11/wheres-mygphone.html)

What Is Android?

Page 9: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

A software platform and operating system for mobile devices

Based on the Linux kernel

Developed by Google and later the Open Handset Alliance (OHA)

Allows writing managed code in the Java language

Possibility to write applications in other languages and compiling it to

ARM native code (support of Google? No)

Unveiling of the Android platform was announced on 5 November 2007

with the founding of OHA

What Is Android?

Page 10: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android is made up of several necessary and dependent parts :

What Is Android?

A hardware reference design.

A Linux operating system kernel.

Open-source libraries for application development.

A run time used to execute and host Android applications.

An application framework.

A user interface framework.

Preinstalled applications.

A software development kit.

Page 11: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Performance

Page 12: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Security

Android is a multi-process system, in which each application (and parts of the

system) runs in its own process. Most security between applications and the

system is enforced at the process level through standard Linux facilities, such as

user and group IDs that are assigned to applications.

Additional finer-grained security features are provided through a "permission"

mechanism that enforces restrictions on the specific operations that a particular

process can perform, and per-URI permissions for granting ad-hoc access to

specific pieces of data.

Page 13: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Google Android Sales to Overtake iPhone in 2012

The OHA is committed to make their vision a reality: to deploy the Android

platform for every mobile operator, handset manufacturers and developers to

build innovative devices

Intel doesn’t want to lose ownership of the netbook market, so they need to

prepare for anything, including Android

Fujitsu launched an initiative to offer consulting and engineering expertise to

help run Android on embedded hardware, which aside from cellphones,

mobile internet devices, and portable media players, could include GPS

devices, thin-client computers and set-top boxes.

More Android devices are coming and some will push the envelope even

further

Future possibilities

Page 14: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

An e-mail client

An SMS management application

A full PIM

A WebKit-based web browser

A music player and picture gallery

A camera and video recording application

A calculator

The home screen

An alarm clock

NATIVE ANDROID APPLICATIONS

Page 15: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android APIs, Full Documentation and Sample code

Development tools

Dalvik Debug Monitor Service (DDMS)

Android Debug Bridge (ADB)

Android Emulator

Online support and blog

Native Development Kit also available

allows developers to implement parts of apps in native-codelanguages like C/C++

Plug in available to use Eclipse integrated developmentenvironment

Developer forums and developer phones from Google, MOTODevstudio from Motorola

SDK

Page 16: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Storage

(Uses SQLite, a lightweight relational database, for data storage)

Connectivity

(Supports GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth(includes A2DP and AVRCP), WiFi, LTE, and WiMAX)

Messaging

(Supports both SMS and MMS)

Web browser

(Based on the open-source WebKit, together with Chrome’s V8 JavaScript engine)

Media support

(Includes support for the following media: H.263, H.264 (in 3GP or MP4

container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC, HE-AAC (in

MP4 or 3GP container), MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and

BMP)

Features of Android

Page 17: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Hardware support

(Accelerometer Sensor, Camera, Digital Compass, Proximity Sensor, andGPS)

Multi-touch

(Supports multi-touch screens)

Multi-tasking

(Supports multi-tasking applications)

Flash support

(Android 2.3 supports Flash 10.1)

Tethering

(Supports sharing of Internet connections as a wired/wireless hotspot)

Features of Android Con.

Page 19: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android Software Stack

Page 20: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Linux kernel :

This is the kernel on which Android is based. This layer contains all thelow-level device drivers for the various hardware components of an Androiddevice

Libraries :

A media library for playback of audio and video media

A surface manager to provide display management

Graphics libraries that include SGL and OpenGL for 2D and 3D graphics

SQLite for native database support

SSL and WebKit for integrated web browser and Internet security

Android Software Stack

Page 21: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android run time :

Core libraries : provide most of the functionality available in the

core Java libraries as well as the Android-specific libraries.

Dalvik virtual machine : a register-based virtual machine that’s

been optimized to ensure that a device can run multiple instances

efficiently.

Application framework :

Exposes the various capabilities of the Android OS to application

developers so that they can make use of them in their applications.

Android Software Stack

Applications :

you will find applications that ship with the Android device(such asPhone, Contacts, Browser, etc.), as well as applications that you downloadand install from the Android Market. Any applications that you write arelocated at this layer

Page 22: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

All applications written in Java and converted to the dalvik executable.dex

Every android app runs its own process, with its own instance of thedalvik virtual machine.

Not a traditional JVM, but a custom VM designed to run multipleinstances efficiently on a single device.

VM uses linux kernel to handle low-level functionality incl. security,threading, process and memory management.

The Dalvik Virtual Machine

Page 23: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Rich, extensible set of Views

apps can includes lists, grids, text boxes, buttons, web browser

Content Providers

allows data access from other applications or share own data

Resource Manager

access to localized strings, graphics, layout files

Notification Manager

enables custom alerts to be displayed in status bar

Activity Manager

Manages lifecycle of applications and provides navigation backstack

Android Application Architecture

Page 24: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Activities

application presentation layer

Services invisible components, update data sources, visible activities, trigger notifications

perform regular processing even when app is not active or invisible

Content Providers shareable data store

Intents message passing framework

broadcast messages system wide, for an action to be performed

Broadcast receivers consume intent broadcasts

lets app listen for intents matching a specific criteria like location

Notifications➤ Toast notification ➤ Status Bar Notification ➤ Dialog notification

Application Fundamentals

Page 25: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

All apps (native and 3rd party) are written using the same APIs and run

on the same run time executable

All apps have APIs for hardware access, location-based services,

support for background services, map-based activities, 2D and 3D

graphics.

App Widgets are miniature app views that can be embedded in other

apps like Home Screen

Applications

Page 26: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android apps do not have control over their own life cycles.

Aggressively manages resources to ensure device responsiveness andkills process/apps when needed.

Active Process – critical priority.

Visible Process – high priority.

Started Service Process.

Background Process – low priority.

Empty process.

App Priority and Processes

Page 27: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Why?

Allow customizable devices

Create Common eco system

Android compatibility is free and easy

Obtain Android source code

Comply with Android Compatibility Definition (ACD) doc

List requirements that need to be met for devices to becompatible with a particular version on Android

Pass the Compatibility Test Suite (CTS)

Automated test harness running on desktop, manages testexecution

Test cases written, packaged as .apk to run on actual device oremulator

Porting guide available for bringing up Android on custom HW

Compatibility

Page 28: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Including a set of C/C++ libraries used by components of

the Android system

Exposed to developers through the Android application

framework

Android Libraries

Page 29: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

System C library - a BSD-derived implementation of the standard C

system library (libc), tuned for embedded Linux-based devices

Media Libraries - based on PacketVideo's OpenCORE; the libraries

support playback and recording of many popular audio and video formats, as

well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG,

and PNG

Surface Manager - manages access to the display subsystem and

seamlessly composites 2D and 3D graphic layers from multiple applications

Android Libraries

Page 30: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

LibWebCore - a modern web browser engine which powers both the

Android browser and an embeddable web view

SGL - the underlying 2D graphics engine

3D libraries - an implementation based on OpenGL ES 1.0 APIs; the

libraries use either hardware 3D acceleration (where available) or the

included, highly optimized 3D software rasterizer

FreeType - bitmap and vector font rendering

SQLite - a powerful and lightweight relational database engine available

to all applications

Android Libraries

Page 31: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Google Market - Part of GMS apps

3rd party apps submitted to Google, approved and distributed throughMarket.

Both Free and Paid apps.

Apps now limited to 50 MB; updates possible through Market

Monetization through ads available.

Available in many countries, not all countries have support for paidapps.

Other Market place applications available – Amazon has announcedits own Android Market place.

App searches filtered based on Manifest file (eg. if a device does nothave trackball, apps using trackball will be filtered out).

Every app publishes a list of components the app will access andpermissions need to be granted before installation.

Apps installed on device and SD card (SD Card from Froyo).

The Android market

Page 32: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision
Page 33: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Multiple device configurations

J2ME has 2 classes of micro devices

Android offers only one

Ease of understanding

J2ME has multiple UI model (MIDlets, Xlets, AWT, Swing …)

Android support for only one, so it would be more easier to understand

than J2ME

Android vs. J2ME

Page 34: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Responsiveness

Dalvik VM vs. JVM

Dalvik VM vs. KVM

Java compatibility

Android runs .dex bytecode

Runtime interpretation of Java bytecode is not possible

Android vs. J2ME

Page 35: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Adoption

Most of mobile phone support for J2ME

But uniformity, cost, ease of development in Android are the reasons

for java developer to program for it

Java SE support

Android support for J2SE more complete than J2ME CDC (except

AWT & Swing)

Android vs. J2ME

Page 36: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Games 52.2% of app sales in 2010

350K apps in iStore, 130K in Android market (294K in may)

Android easiest to write for

Tools plus getting published

Fragmented hardware

Apple vs. Android

Page 37: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Why Android

For end users

No license fee

More than 30K application in the market with 61% are free apps

Supported by dozens of hardware manufacturers

Low price smart-phone devices

Abilities to integrate with Google’s services

Page 38: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Android Takes Lead in US Smartphone Market

In January 2011, 31.2% of smartphone market, (7.1% in 2010),

30.4% Blackberry, and 24.7% iPhone

http://www.comscoredatamine.com/2011/03/android-takes-lead-

in-u-s-smartphone-market/

Why?

Why Android

Page 39: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

Requires Google Developer Account

$25 fee

Link to a Merchant Account

Google Checkout

Link to your checking account

Google gets 30% you get 70%

Publishing to the Market

Page 40: Chapter 1 Hello, Androidsite.iugaza.edu.ps/wp-content/uploads/CH1 Hello, Android.pdf · A commitment to openness, a shared vision for the future, and concrete plans to make the vision

NEXT LECTURE CH2

We will be using Eclipse

➤ Set it up.