CSCI 485 : Mobile Applications Development using Android Lecture 1

fansbutterflyΚινητά – Ασύρματες Τεχνολογίες

19 Ιουλ 2012 (πριν από 5 χρόνια και 29 μέρες)

386 εμφανίσεις

CSCE
485
: MOBILE APPLICATIONS
DEVELOPMENT (USING ANDROID)


LECTURE
1

Mohamed
Shalan

CSCE
485

Agenda


Mobile Devices


Mobile Platforms


The Android Platform


Course Information


2

Mobile Devices


Are small computer devices that can be carried around. The
list includes (but not limited to):


Smart Phones


Personal Digital Assistant (PDA)


Personal Navigation Devices (PND)


Tablets


E
-
book readers


These devices have the following characteristics:


Mostly connected (
3
G,
4
G,
WiFi
,
WiMax
, ….)


Have a touch screen and/or miniature keyboard


Limited computer resources compared to desktop computers


Smaller screen, less memory, less processing capabilities, Battery
powered,….


3

Trends

4


There will be
5
.
3
billion mobile subscriptions by the
end of
2010
, estimates
The International
Telecommunication Union

[ITU](October
2010
).


That is equivalent to
77
percent of the world
population.


Prediction: In
2013
the number of Mobile Phones
will overtake the number of PCs
-

Gartner



Mobile Internet Will Soon Overtake Fixed

Internet,
Morgan Stanley

Trends

5

Programming Mobile Devices

6


Earlier Mobile Devices were closed systems.
Nobody could develop applications for them.


Palm (now part of HP now) one of the first
manufacturers that allowed users to develop
applications for its PDA’s and Mobile Phones (I
wrote my first application for Palm OS in
2001
).


Microsoft allowed users to develop applications
for the Windows Mobile platform (used for PDAs
and Smart Phones).


Now the mobile devices landscape is dominated
by few platforms (All provides SDK’s and Dev.
Tools).

Big Players


Smartphone

7


Smart Phones Market Share Q
42011

Source: Gartner

Big Players


Smartphone

8

Big Players
-

Tablets

9

Big Players


Android (ARM, x
86
, MIPS, …)


Smart Phones & Tablets


>
331
M devices (Q
1 2012
)


Open
-
source (Not Really!)


Backed by OHA


Multitasking


Programming: Java (C/C++
withJNI
)


iOS

(ARM only)


Smart Phones & Tablets


156
M devices were sold during
2011
alone!


Closed Platform (Apple)


Multitasking


Multi
-
touch interface


Programming: Objective
-
C



BlackBerry OS (ARM)


Proprietary (RIM)


Multitasking


Many enterprise features


Programming: Java ME,

Adobe AIR (tablet)


Windows Phone
7
(ARM only)


Closed Platform (Microsoft)


No multitasking


Programming: Silverlight/XNA,
C#.NET/VB.NET


10

Big Players


Apps Markets

11

Myth:

Apps are making profits
for Apple & Google

Reality:

Apps drive the platform’s
core business not content
profits for Apple this is
device sales; for Google
this is on
-
line ads

iOS

vs. Android

12

Android

iOS

OHA (Google)

Apple

No.
2
in Tablets

No.
1
in Tablets (
iPad
)

No.
1
in Smart Phones

No.

2
in Smart Phones

Free development

tools based on Eclipse
and free SDK (
25
USD to publish on
Android Market)

99
USD/Year to get

the SDK and the
development tools (
Xcode
)

Native

Applications in Java (part of the
application can be in C/C++)


Native

Applications in
Objective
-
C

So many stores;

Google Play is the official
one (
30
/
70
). Also, Amazon
Appstore

becomes popular.

Apple Apps Store (
30
%
-
70
%)

400
k Apps (Jan
2012
);

10
B downloads
(Dec.
2011
)

500
,
000
Apps and
18
B

downloads
as of
Oct.

2011

Why Android?

13


Open Source


Number
1
in Smart Phones (
55
.
1
%) ; Number
2
in Tablets


934
,
000
devices are activated daily (Q
1 2012
)!


331
M devices in the wild (Q
1 2012
)!


Open Platform backed by big Players (Google, Motorola, …)


Free Development tools available for major desktop OS’s
(Linux, Windows and OSX)


Development is done in Java


Android Devices

14

HTC
Evo

Motorola Photon

Samsung Galaxy S II

Samsung Galaxy S III

What is Android?



A software stack for mobile devices that includes an
operating system, middleware, and key applications”


Based on the Linux kernel


Allows writing managed code in the Java language


Possibility to write applications in other languages and
compiling it to ARM native code


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


Unveiling of the Android platform was announced on
5
November
2007
with the founding of OHA



15

Open Handset Alliance

16


As per www.openhandsetalliance.com


“a group of
84
technology and mobile companies who have
come together to accelerate innovation in mobile and offer
consumers a richer, less expensive, and better mobile
experience. Together we have developed Android™, the
first complete, open, and free mobile platform.”


Android Architecture

17

Android Architecture


Linux Kernel (
2
.
6
.x &
3
.x) [Assembly & C]


Linux Kernel provides a hardware abstraction layer, letting the upper
levels remain unchanged despite changes in the underlying hardware.


kernel

is the main component of most computer

operating systems.


As new accessories appear on the market, device drivers can be written
at the Linux level to provide support, just as on other Linux platforms.


A

device driver

or

software driver

is a

computer program

allowing higher
-
level
computer programs to interact with a

hardware

device

18

Android Architecture

19


Android Run
-
Time


Core Libraries (Java)
Provide most of the functionality available
in the core libraries of the Java programming language:


Dalvik

Virtual Machine (VM):


Optimized Java VM;


Executes .
dex

files


Each Android application runs in its own process, with its own
instance of the
Dalvik

VM.


Not a traditional JVM, but a custom VM designed to run
multiple instances efficiently on a single device


JVM

20


A virtual machine (VM) is a
software implementation of a
machine (i.e. a computer) that
executes programs like a physical
machine.


A

Java virtual machine

(
JVM
) is
a

virtual machine

capable of
executing

Java
bytecode
.


Bytecode

is the JVM instruction set


Why JVM?


"write once, run anywhere"

Source: Wikipedia; retrieved: Jan
2012

Java vs. C++

21

HW (X
86
)

OS
(Windows)

JVM

Java App
(.class)

HW (PPC)

OS (Linux)

JVM

Java App
(.class)

HW (X
86
)

OS
(Windows)

Application
(.exe)

HW (X
86
)

OS (Linux)

Application
(.exe)

.
cpp

VC++

g++

.java

javac

Android Architecture

22


Libraries [C/C++]


Set of C/C++ libraries used by components of the Android system


Exposed to developers through the Android application framework


Webkit
,
SQLite
,
OpenGLES
,
libc
, …


Application Framework [Java]


Enabling and simplifying the reuse of components


Developers have full access to the same framework APIs used by the
core applications.


Activity; Intent and Intent
-
Filter; Services; Content Providers; Broadcast
Receivers; Notification Manager ….


Applications [Java]


Email Client, SMS Program, Calendar, Maps, Browser, Contacts, etc…..



Android Development Tools


Android SDK (SW Development Kit)


Class library


Development tools:
adb
,
dx
,
aapt
, ….


Device Emulator (Android Virtual Devices [AVD]): based on
QEMU


Emulator: Same as VM; it simulates another computer hardware;
AVD simulates Android Smart Phones and Tablets


Samples & Documentation


IDE


Eclipse + ADT (Android Development Tools) Plug
-
in


Eclipse:
Open development platform for building, deploying and
managing software across the lifecycle


23

Android Development Tools

24

Eclipse

AVD

(Device Emulator)

Host

Target

USB

Android Releases

25

Platform

API Level

Distribution (June
12
)

Android
4
.
0
(Ice Cream Sandwich)

14
-
16

7
.
1
%

Android
3
.
0
-
3
.
2

(Honeycomb)

11
-
13

Tablets only (
2
.
7
%)

Android
2
.
3

(Gingerbread
)

9
/
10

65
%

Android
2
.
2
(Froyo)

8

19
.
1
%

Android
2
.
0
/
2
.
1
(Eclair)

7

5
.
2
%

Android
1
.
6
(Donut)

4

0
.
6
%

Android
1
.
5
(Cupcake)

3

0
.
3
%

Android Releases

26


Guess the name of the next Android Platform (
5
)


Native Apps


Developed

using

the

Android

SDK

and

installed

on

user

devices



Compiled Java code, with data and resource


bundled by
Android Asset Packaging tool (AAPT) into Android package or
.
apk


All applications have Android Manifest file in its root directory


Provides essential information about app


Could be installed directly on phone, but necessary to be
distributed thru Market

27

Web Apps


An alternative to standalone
apps


Developed using web
standards and accessed
through browser


nothing to
install on devices


Mixing native and web apps is
also possible (
Called Hybrid)


Native apps
can embed web
pages using “
Webview
” in
Android app


28

Android Development

29

Course Information

30


Website:


http://www.cs.aucegypt.edu/~mshalan/


Textbook:


Learning
Android,
Marko
Gargenta
,
2011
(available
online
)


Beginning Android™ Application Development, Wei
-
Meng

Lee,
2011
(Available
online
).


References:


Android recipes (
available online
)


Beginning Android
2
(
available online
)


Office
Hours:
Sun, Mon
& Thu
10
:
00
-
11
:
00
AM


TA:
TBD


Course Information

31


Grading Schema


No exams!


Attendance
& Participation (
5
%)


More than
5
absence days without
an official excuse will
result you
F

in this course
.


Individual Assignments
(
45
%)


Late
assignments:
50
% off (max
2
late days
)


Group Project
(
50
%)


Course Information

32


Learn skills for creating and deploying mobile
applications for Android using Java


with particular emphasis on software engineering topics.


focus on Android
2
platform (~
95
%)


Also, emerging mobile web technologies will be covered as well


Build cross platform apps


Other mobile platforms will be covered slightly


iOS


Nokia (QML)


Interesting stuff might be added if resources are
available