02-android-sw-archx

burgerraraSoftware and s/w Development

Nov 18, 2013 (3 years and 9 months ago)

106 views

U
NIT
2

CIS

400/600

Page
1

U
NIT
2
:

ANDROID

SOFTWARE

ARCHITECTURE


We discuss the typical structure of software development systems, in general, then show how the
Android SDK

fit
s

into the typical scheme.


1.

D
EVELOPMENT
S
YSTEMS
("S
OFTWARE
S
TACKS
"),

IN
G
ENERAL


a)

At bottom, some
hardware substrate

(actual family of devices on which to run applications) is assumed.


b)

Above the hardware is a
software stack

(layers of interacting software

at different levels of abstr
action
)
,

spare or rich.


c)

Closest to the hardware is the
operating system

(
OS
); for storage
-
limited devices, an OS
kernel

(stripped
-
down OS)
or
micro
-
kernel

(bare
-
minimum kernel)
may have to suffice.


d)

Above the OS, are
low
-
level libraries

that perform
basi
c

functions

at relatively high efficiency; these would
include access to lower
-
level data types, networking facilities, file
-
level I/O, multi
-
threading,
graphical
rendering,
etc. There may be several levels of such foundational libraries.


e)

Above the found
ational libraries are
frameworks
, essentially collec
tions of libraries that provide
high
-
level

intermediation between application programs
and the lower
-
level libraries.


f)

Frameworks provide
a
high
-
level GUI
toolkit
, etc., and so

contribute to the distinctive look
-
and
-
feel of
applications developed using particular software stacks, such as those used to create
iOS

or Android
applications.


g)

Frameworks are more than just high
-
level libraries, however. They provide generic skeletal
program
structures that particular applications complete
, partially

via
callbacks
. That is, not only does an application
invoke framework methods and functions, the framework calls methods the application is expected to
implement in order to conform to th
e program structure required by the framework.

Frameworks therefore
exert considerable control over program behavior.


h)

Integrated Development Environments

(
IDEs
)
are typically included as they
can help developers take
advantage of
the remaining parts of
p
articular software stacks, either natively or through "plug
-
ins."


i)

Development systems typically privilege one language over the others for creating applications.


j)

For applications intended to run on hardware other than the general
-
purpose computers on whi
ch they are
developed, the software stack should include accurate
device emulation
, so that
actual target
devices need
not be used (or owned) until final testing approaches.


2.

A
NDROID
SDK

(
http:/
/developer.android.com/guide/index.html
)


a)

At bottom, the target
hardware
platform is any
Android
-
compatible device
.


b)

The software stack (particularly its frameworks) is quite rich, and
all
open source.


c)

The operating syst
em used by the target platforms,
and simulated by the device emulator
,

is
a
Linux

kernel
.

Like Mac OS X, Linux is a UNIX variant.


d)

Above
Linux
, the low
-
level libraries are mostly written in C
/C++
.

T
hese include librar
ies such as
OpenGL

and
SQLite
, a
s well as

media
, SSL and Webkit librar
ies, etc.



e)

The
Android

A
rchitecture

(
http://developer.android.com/guide/basics/what
-
is
-
android.html
), subsuming
the Android Application Framework (AAF) which
includ
es

GPS supp
ort, etc.
, provides the high
-
level
application programming interface.



U
NIT
2

CIS

400/600

Page
2

f)

Just about all features of the hardware are ma
de accessible through AAF
.


g)

The IDE of choice for
Android

development is
Eclipse
,
for which Google provides a
n elaborate

plug
-
i
n
:
the
Android Development Tools

(
ADT
)
, which

greatly simplify
mobile app development for Android devices.
This includes control over the c
onfiguration
of
Android Virtual Devices

(
AVDs
)

to
be
simulated
, and
simulation of some location and sensor sub
-
devices
.

Ec
lipse is an open
-
source project supp
orted by the
Eclipse Foundation (formerly

it was commercially distributed as

IBM's Visual Age IDE)
.


h)

The ADT's graphical layout tool is considerably less refined than Apple's Interface Builder.

This is partially a
refle
ction of the wider class of devices an Android application may want to support.


i)

Android

applications are expected to be written in

Java
, an
d the Android Run Time support provides
additional libraries and the Dalvik Virtual Machine
.


j)

Dalvik is
not, as it t
urns out, a traditional
stack
-
oriented
Java VM
.

Ra
ther, Dalvik supports a register
-
oriented

virtual

machine

and takes advantage of a compressed bytecode format, for reasons of efficiency.


k)

Java
itself
was developed at Sun Microsystems, now owned by Oracle

Corp.; Java is "open
-
source", after a
fashion, though control of the de facto standard rests with Oracle.


l)

The
Android Emulator

can be run from within Eclipse
(it can also be run separately),
and supports AVDs of
your choosing
.