47
Android Overview Francesco Mercaldo, PhD Post-Doctoral researcher Corso di Sicurezza delle Reti e dei Sistemi Software Università degli Studi del Sannio ([email protected]) Things are not always what they seem; the first appearance deceives many ; the intelligence of a few perceives what has been carefully hidden.” Phaedrus

Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1 ... Advantages (as compared to fixed devices)

  • Upload
    dangque

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android Overview

Francesco Mercaldo, PhD

Post-Doctoral researcher

Corso di Sicurezza delle Reti e dei Sistemi Software

Università degli Studi del Sannio

([email protected])

“Things are not always what they seem; the first appearance deceives many;

the intelligence of a few perceives what has been carefully hidden.”

Phaedrus

Page 2: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Why Mobile App Development?

The fact that we can! Only a few years ago you had to

be in the Motorola inner circle to do it!

Mobile platform is the platform of the future

Double-digit growth in world-wide smartphone ownership3

Job market is hot

Market for mobile software surges from $4.1 billion in 2009 to

$17.5 billion by 20121

2010 Dice.com survey: 72% of recruiters looking for iPhone app

developers, 60% for Android1

Dice.com: mobile app developers made $85,000 in 2010 and

salaries expected to rise2

1 http://www.businessweek.com/technology/content/oct2010/tc20101020_639668.htm 2 http://it-jobs.fins.com/Articles/SB129606993144879991/Mobile-App-Developers-Wanted-at-Ad-Agencies 3http://www.gartner.com/it/page.jsp?id=1466313

Page 3: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

A matter of fact

85% of the population owns a smartphone

96% of us use our phones to take photos

70% of mobile devices are used to take

“selfies.”

Page 4: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

The OS Market Share

Page 5: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Only a year ago…

Morgan Stanley

Page 6: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

6

What is Android?

Android is a software stack

for mobile devices that

includes an operating

system, middleware and

key applications.

Page 7: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

What about 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

Page 8: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

8

OHA (Open Handset Alliance)

A business alliance consisting of 47

companies to develop open standards for

mobile devices

Page 9: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

OHA (Open Handset Alliance)

Page 10: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

10

Phones

HTC G1,

Droid,

Tattoo Motorola Droid (X)

Suno S880 Samsung Galaxy Sony Ericsson

Page 11: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

11

Tablets

Velocity Micro Cruz Gome FlyTouch Acer beTouch

Dawa D7

Toshiba Android

SmartBook

Cisco Android Tablet

Page 12: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

SmartWatch

Page 13: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

ChromeCast

Page 15: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android Washing Machine

Page 16: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Brief History

Ice cream Sandwich Android 4.0+

Page 17: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Distribution of Android Devices

Distribution of Android operating systems used by Android phone owners in

June 2014, by platform version

http://www.statista.com/statistics/271774/share-of-android-platforms-

on-mobile-devices-with-android-os/

Page 18: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android HW support Android is a software platform for mobile

devices based on the Linux operating system

and developed by Google and the Open

Handset Alliance

OS: Linux kernel - version 2.6/3.x (from

Android 4.0)

Emulator: on Mac, Windows, Linux

Hardware support:

GSM Telephony

Bluetooth, 3G and WiFi

Camera, GPS, compass and accelerometer

Page 20: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Linux Kernel

Android relies on Linux version 2.6/3.x for

core system services such as security,

memory management, process management,

network stack and driver model.

The kernel also acts as an abstraction layer

between the hardware and the rest of the

software stack.

Page 21: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Runtime Every Android application runs in its own process, with

its own instance of the Dalvik virtual machine.

The DalvikVM executes files in the Dalvik Executables

(.dex) format which is optimized for minimal memory

footprint.

The VM is register-based and runs classes compiled by

a Java language compiler that have been transformed

into the .dex format by the included "dx" tool.

The dalvik VM relies on the Linux kernel for underlying

funcionality such as threading and low-level memory

management.

Page 22: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Libraries

Android includes a set of C/C++ libraries used

by various components of the Android system.

Surface Manager - manages access to the

display subsystem and seamlessly composited

2D and 3D graphic layers from multiple

application

Media Libraries - support playback and

recording of many popular audio and video

formats, as well as static image file

FreeType - bitmap and vector font rendering

SQLite - a powerful and lightweight relationa

database engine available to all applications

Page 23: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Application Framework Android will ship with a set of core applications

including an email client, SMS program,

calendar, maps, browser, contacts and other. All

application are writter usgin Java.

Underlying all application is a set of services and

systems, including:

A rich and extensible set of Views that can be used to

build an application, including lists, grids, text boxes,

buttons and even an embeddable web browser.

Page 24: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Mobile Devices: Advantages (as

compared to fixed devices)

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

Page 25: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

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

Page 26: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

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

Page 27: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

What Should Students Already

Know?

Java!

– inheritance, method overriding

– interfaces, casting

– exceptions

– debugging

– reading API documentation

Eclipse

– easy to pick up quickly, though

Page 28: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android

Android is an open source operating system,

created by Google specifically for use on

mobile devices (cell phones and tablets)

Can be programmed in C/C++ but most app

development is done in Java (Java access to

C Libraries via JNI (Java Native Interface))

Supports Bluetooth, Wi-Fi, and 3G and 4G

networking

Page 29: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

iOS

Apple’s mobile OS for phones (iPhone),

tablets (iPad), handhelds (iPod),

based on BSD Unix

Application programming done in Objective C

Supports Bluetooth, Wi-Fi, and 3G and 4G

networking

Page 30: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android Application

Development

Eclipse IDE Android

SDK

Android Emulator

Android Mobile Device

Page 31: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

iOS Application Development

XCODE IDE iOS SDK

iOS Simulator

iOS Mobile Device

Page 32: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android development

Android Manifest

Resource XML

Java Source

Generated Class

Java Compiler

Android Libraries

.dex File

Dalvik VM

Page 33: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

iOS development

Objective C Source

.xib file Objective C Compiler

Foundation Framework Cocoa Libraries

Simulator or Device

Interface Builder

Xcode

Page 34: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Development

process for an

Android app

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

Page 35: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android Apps

Built using Java and new SDK libraries

No support for some Java libraries like Swing &

AWT

Oracle currently suing Google over use

Java code compiled into Dalvik byte code

(.dex)

Optimized for mobile devices (better memory

management, battery utilization, etc.)

Dalvik VM runs .dex files

Page 36: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

What makes an Android

Application

Activities

Services

Content Provider

Intent

Broadcast Receivers

Notification

Page 37: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Activities vs Services

Page 38: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Intent and Broadcast Receiver

Page 39: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Content Providers

Page 40: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Notifications

Page 41: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Building and running

ADB is a client server program that connects clients on developer

machine to devices/emulators to facilitate development.

An IDE like Eclipse handles this entire process for you.

http://developer.android.com/guide/developing/building/index.html#detailed-build

Compiled resources

(xml files)

Android Debug Bridge

Page 42: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Applications Are Boxed

By default, each app is run in its own Linux

process

Process started when app’s code needs to be

executed

Threads can be started to handle time-consuming

operations

Each process has its own Dalvik VM

By default, each app is assigned unique Linux ID

Permissions are set so app’s files are only visible to

that app

Page 43: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android Architecture

Page 44: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android Design Philosophy

Applications should be:

Fast

Resource constraints: <200MB RAM, slow processor

Responsive

Apps must respond to user actions within 5 seconds

Secure

Apps declare permissions in manifest

Seamless

Usability is key, persist data, suspend services

Android kills processes in background as needed

Page 45: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Apple vs. Google

Open Handset Alliance

30+ technology companies

Commitment to openness, shared vision, and

concrete plans

Compare with Mac/PC battles

Similar (many PC manufacturers, one Apple)

Different (Microsoft sells Windows, Google gives

away Android)

Page 46: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Android resources

Page 47: Android Overview - ISWATlab€¦ · Android Overview Francesco Mercaldo ... 1  ... Advantages (as compared to fixed devices)

Any Questions ?