6011 Lecture 07x

crookpatedhatMobile - Wireless

Dec 10, 2013 (3 years and 9 months ago)

103 views


The
OHA

(
O
pen

H
andSet

A
lliance
)
is a group

of
84

technology and mobile companies
who
have come together to
accelerate innovation

in
mobile
technology
.


Aims to give consumers a better
mobile experience
.



OHA

developed
Android
,
the first complete,
open
and free mobile
platform and are
committed to
commercially
deploying devices
and
services


using
the
Android Platform
.


Android

is a
software stack
for mobile devices that
includes an
OS
,
middleware

and
key applications
.



The
Android SDK
provides the
tools

and
APIs

that are necessary to begin developing
applications using
Java
.


Key
components

of the Android
software stack
.


Applications
.


Android ships with core applications including.


eMail
,
SMS
,
Calendar
,
Maps
,
Browser

etc.


These applications are written using
Java
.



Application Framework
.


With an open development platform, Android allows
developers to
produce rich
&
innovative applications
.


Developers may take advantage of
device hardware
.



Developers have
complete access
to the same
framework
API
s used by the
core applications
.


The whole architecture simplifies
component reuse
.


Libraries
.


Android has a set of
C
/
C++
libraries used by various
components of the Android system including.


Each
capability

is
exposed

to developers
through the
Application Framework
.


System C Library
-

BSD
-
Derived
libc
.


Media Libraries
-

PacketVideo's
OpenCORE
.


LibWebCore

-

Android & Embeddable Browsers.


SGL

-

2D &
OpenGL ES
-

3D.


SQLite

-

Relational Database Engine.


Android Runtime
.


Android has a set of
Core Libraries
that provide
most of the
functionality

available in
Java
.


Every Android application runs in a
separate
process
, with its
own instance
of the
Dalvik VM
.


The
Dalvik VM
in turn . . .


Allows a device to run
multiple VM
s

efficiently
.


Will execute a file in the .
dex

format following
conversion from
Java

classes by the
dx

tool.


Linux Kernel
.


Android’s relies on
Linux 2.6
for core system services
such as
security
,
memory management
,
process
management
,
networking

and
drivers
.


Android offers a
plug
-
in

for the
Eclipse IDE
.


The
ADT

(
A
ndroid

D
evelopment

T
ools
) is designed
to give developers an integrated environment
in which to construct Android applications.


Developing in
Eclipse

with the
ADT

is a highly
advisable approach and is the fastest way to
get started with Android development.

http://www.eclipse.org/

Package Explorer
showing common
Android Application
components.

Outline
showing
Java

class elements.

Errors
&
Warnings
showing
Java

warning message.

Code Window
showing sample
Android Application
written in
Java
.

GUI Design Window
showing sample
Android Application
.


An activity is a
single screen
with a
user interface
.


An activity may
work alongside
others to form
a
cohesive user experience
in an application.


However, each activity is
independent

of the others.


As such, a different application can start any activity
in an application (assuming said application allows it)



An
activity

is implemented as a
subclass

of
Activity
.


Key system
events

along with
Activity

and
Application

life
cycle states.

public class
StudentsActivity

extends Activity {



@Override


public void
onCreate
(Bundle
savedInstanceState
) {


super.onCreate
(
savedInstanceState
);


// The activity is being created.


}



@Override


protected void
onStart
() {


super.onStart
();


// The activity is about to become visible.


}


. . .


A service is an
invisible component
that performs
lengthy operations
or work for a remote process.


A service does not provide a
user interface
.


Another component, such as an activity, may start
the service in the background and simply let it
execute or bind to it so as to interact directly.



A
service

is implemented as a
subclass

of
Service
.


A
content provider manages
shared data
.


File System
.


SQLite

Database.


Web
/
Network Service
.



. . .
or any
persistent
storage
location!


Through a content
provider,
many
applications

can
query

or even
modify

the
shared data
.


AVD

(
A
ndroid

V
irtual

D
evice
)


An emulator
configuration that
models
an actual
device
by defining hardware and software
options.


QEMU

Based.


ARM
v5.


16
-
bit
LCD
.


GSM

Modem.


SIM

Cards.

AVD

of

Android 4.0


Define an
AVD

with the graphical
AVD Manager
.

AVD Manager
from
Eclipse IDE


SQLite

is a
software library
that implements a . . .


Self
-
Contained.


Server Less.


Zero Configuration.


Transactional.


. . . SQL
database engine
.



SQLite

is (
as of
2011) the most
widely deployed
SQL
database engine in the world with the
source code
for
SQLite

in the
public domain
.


Android

has
full support
for
SQLite
.


A database will be accessible by name to any class
in the application, but not outside the application.



The standard way to create a new
SQLite

database
is to create a new sub
-
class of
SQLiteOpenHelper

and override the
onCreate

method.


In the
onCreate

method you execute an
SQLite

DDL

statement to create tables in the database.

public class
StudentsOpenHelper

extends
SQLiteOpenHelper

{


. . .


private static final String
TABLE_CREATE

=


"CREATE TABLE students (name TEXT, nationality TEXT);";



StudentsOpenHelper

(Context
context
) {


super(context,
DATABASE_NAME
, null,
DATABASE_VERSION
);


}



@Override


public void
onCreate
(
SQLiteDatabase

db) {


db.execSQL
(
TABLE_CREATE
);


}

}


You get an instance of your
SQLiteOpenHelper

by calling the constructor that you have defined.


You read and write to the database by calling
getReadableDatabase

&
getWritableDatabase
.


Both return an
SQLiteDatabase

object that represents
the database and provides methods for operations.



You execute
SQLite

queries using the
query

methods
of
SQLiteDatabase
, which accept various parameters,
such as table, projection, selection, grouping etc.


Android

uses a
sand box
to host an application.


An
application

must
explicitly share
resources/data
by
declaring permissions
they need for
extra
capability
not provided by the sand box.


They statically declare these permissions so the
Android system
prompts

the user for consent.


Android has
no mechanism
for
granting permissions
dynamically
as this would complicate the user
experience to the detriment of security.


The
sand box
does
not depend
on the
technology

used to
build

an application.


Thus, the
Dalvik

VM
is not a security boundary.


An application can run native code (
i.e.

Android NDK
)


Every application type (
Java
,
Native

etc
) runs
in a sand box in the same way and have the
same degree
of
security
.


Knowing the relative
frequency

of devices
running

a
given version
of the
platform

helps developers . . .


Appreciate

the
landscape of device
distribution
.


Decide
how to
prioritize

the
development

of
application
features for
devices
currently in

the
hands of users.









Welcome
to
Android
Design !


http://developer.android.com/design/