android overview - iswatlab

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

Upload: others

Post on 02-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

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

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

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.”

The OS Market Share

Only a year ago…

Morgan Stanley

6

What is Android?

Android is a software stack

for mobile devices that

includes an operating

system, middleware and

key applications.

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

8

OHA (Open Handset Alliance)

A business alliance consisting of 47

companies to develop open standards for

mobile devices

OHA (Open Handset Alliance)

10

Phones

HTC G1,

Droid,

Tattoo Motorola Droid (X)

Suno S880 Samsung Galaxy Sony Ericsson

11

Tablets

Velocity Micro Cruz Gome FlyTouch Acer beTouch

Dawa D7

Toshiba Android

SmartBook

Cisco Android Tablet

SmartWatch

ChromeCast

Android Washing Machine

Brief History

Ice cream Sandwich Android 4.0+

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/

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

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.

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.

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

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.

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

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

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

What Should Students Already

Know?

Java!

– inheritance, method overriding

– interfaces, casting

– exceptions

– debugging

– reading API documentation

Eclipse

– easy to pick up quickly, though

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

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

Android Application

Development

Eclipse IDE Android

SDK

Android Emulator

Android Mobile Device

iOS Application Development

XCODE IDE iOS SDK

iOS Simulator

iOS Mobile Device

Android development

Android Manifest

Resource XML

Java Source

Generated Class

Java Compiler

Android Libraries

.dex File

Dalvik VM

iOS development

Objective C Source

.xib file Objective C Compiler

Foundation Framework Cocoa Libraries

Simulator or Device

Interface Builder

Xcode

Development

process for an

Android app

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

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

What makes an Android

Application

Activities

Services

Content Provider

Intent

Broadcast Receivers

Notification

Activities vs Services

Intent and Broadcast Receiver

Content Providers

Notifications

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

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

Android Architecture

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

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)

Android resources

Any Questions ?