Application Development for Mobile and Ubiquitous Computing ...

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

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

854 εμφανίσεις

Department of Computer Science
Institute for System Architecture, Chair for Computer Networks

Application

Development
for

Mobile
and

Ubiquitous

Computing



9.
Platforms

Android
,
iOS

and

WP7

Dr. Ing. Thomas Springer

Technische Universität Dresden

Chair

of

Computer Networks

Lecture

Structure

Dr. Thomas Springer

Slide
2

Application Development
-

9. Platforms

Adaptation and
Context
-
awareness
Mobile Internet
Mobile Middleware
Application Development
Enabling Technologies and Challenges
Disconnected
Operations
Mobile
Databases
Location
-
based
Services
Communication
Mechanisms
Android
iOS
.
Net Compact
Framework
/
Windows
Phone
7
Java ME
OSGi
Cross
-
Platform Development
Structure


Java ME


OSGi



Android


iOS


Windows Phone 7


Dr. Thomas Springer

3

Application Development
-

9. Platforms


Created

by
:
Sun Microsystems,
acquired by Oracle Corporation in
2010


Target
devices
:
cellular

phones
,
PDAs,
embedded

devices


Operating System:
any

system


Approach:
open
source
,

no

hardware

restrictions


Programming
:
Java


Development:
any hardware


Development
tools
:
various

IDEs
and

development

kits


App
Provisioning
:
Over
the

air

provisioning

by

vendor


Developer Program:
free


Dr. Thomas Springer

4

Application Development
-

9. Platforms

Reviewing

Java ME

Mobile Device
Hardware
Operating System
CLDC
Configuration
,
KVM
Midlet Suite
Midlet Suite
...
MIDP Profile
Optional Packets
ANDROID


Created

by
:
Open
Handset

Alliance,

driven

by

Google,


First Release:
Android 1.0
beta

in
November
2007


Target
devices
:
smartphones

and

tablets

from

different
vendors


Operating System: Linux Kernel


Approach: open
source

(
Apache 2.0 license, some libs
excluded (e.g
.
Google
Maps
)
,
heterogeneous

hardware


Programming
: Java


Development:
any

hardware


Development
tools
:
Eclipse

Plugin

+
Android

SDK


App
Provisioning
:
Android

market

maintained

by

Google,
additional
markets

(
AndroidPit
, …)


Developer
Program
:

Dr. Thomas Springer

6

Application Development
-

9. Platforms

Android

Overview

Android

Architecture


Application

Framework
allows

reuse

and

exchange

of

components


Libraries


Media Libraries
supporting

many

popular

formats
, (MPEG4, H.264,
MP3, AAC, AMR, JPG,
and

PNG)


SQLite

-

lightweight

relational
database

engine


Google
Maps

support


Integrated Browser
based

on
WebKit



Optimized

graphics

libraries

(2D
library
, 3D
library

based

on OpenGL


Special VM (
Dalvik

VM)


Linux Kernel (
based

on
version

2.6)


threading


low
-
level
memory

management


hardware

drivers


power
management





Dr. Thomas Springer

7

Application Development
-

9. Platforms

Mobile Device
Dalvik VM
+
Core libraries
Hardware
Libraries
App
.
apk
App
.
apk
...
Application Framework
Linux Kernel
Dalvik Virtual Machine


Alternative Java runtime implementation


no Sun/Oracle certification


basically just the syntax of the
progr
. language is the
same


Dalvik

byte code

o
must be compiled for
Dalvik

VM


no full Java ME, no full Java SE

o
four major libraries '
lang
', '
util
', '
io
', 'net' fully
available


Cross
-
compiler for Java standard
bytecode


Optimized for mobile computers


memory management


every application runs in its own process


optimized for many parallel VMs


Dr. Thomas Springer

8

Application Development
-

9. Platforms

Anatomy of an Android application


Four

building

blocks


Activities
, Broadcast
Intent

Receiver, Services, Content
Providers


Android

Apps
run

in separate
processes


Inter
-
process

communication

based

on AIDL
interfaces


Used

components

have

to

be

declared

in
the

Android

Manifest
file


Process
Dalvik VM
Local Service
Activity A
Process
Dalvik VM
Remote Service
Inter
-
process
communication
AIDL
Activity B
intent
broadcast
intent
service
Binder
Dr. Thomas Springer

9

Application Development
-

9. Platforms

Building Blocks
-

Activities


Activity:



a single screen of the application


extends the Activity class


consists of user interface elements (views) that respond to events


may return a value to another activity


When a new screen opens, the previous is put onto a history
stack.


methods of activity reflect lifecycle


initialized
visible
active
onResume
onPause
onStart
onStop
inactive
onRestart
removed
onCreate
onDestroy
Dr. Thomas Springer

10

Application Development
-

9. Platforms

Building

Blocks
-

Services


Service:


background thread working independent from the UI


Local and Remote Services


Activities can connect through
bindService
()


When connected, communication is done by an interface
exposed by the service; the interface is based on the AIDL
(Android Interface Definition Language).

initialized
running
onStart
removed
onCreate
onDestroy
Dr. Thomas Springer

11

Application Development
-

9. Platforms


Intent
:


Events/
messages

exchanged

between

Activities

at

application

level


"message objects" used to move from one activity to another


Consists of an Action string, URI and payload


Common action values are MAIN (to open an app), VIEW, PICK
and EDIT


Example: "VIEW" with web address opens the browser, "CALL"
calls a provided number


Intent Filter express ability of component to handle particular
intent types



BroadcastReceiver
:



Broadcast intents represent events propagated by the system
(e.g. battery low, screen off, boot completed)


BroadcastReceiver

is special intent filter for system messages



Dr. Thomas Springer

12

Application Development
-

9. Platforms

Building Blocks
-

Intents

Android

Manifest


AndroidManifest.xml necessary for every application


Describes the application‘s elements and when they should be
initialized or activated


Includes a list of permissions the application is offering or
needing (e.g. for access to network or contacts data); so on
installation, the user can grant or deny these.

<?xml version="1.0" encoding="utf
-
8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"


package="com.my_domain.app.helloactivity">


<application android:label="@string/app_name">


<activity android:name=".HelloActivity">


<intent
-
filter>


<action android:name="android.intent.action.MAIN"/>


<category android:name="android.intent.category.LAUNCHER"/>


</intent
-
filter>


</activity>


</application>

</manifest>

Dr. Thomas Springer

13

Application Development
-

9. Platforms


UI
is

based

on
Screens


Activities

create

and

control

screens

(
one

activity

per
screen
)


contain

application

logic
,
layout

and

views


Views
as

visible

elements

of

UI


Base
class

android.view.View


Layouts
arrange

views

on
screen


Base
class

android.view.ViewGroup
, (i.e.
layout

is

group

of

views
)






Dr. Thomas Springer

14

Application Development
-

9. Platforms

Android

UI
Creation

Dr. Thomas Springer

15

Application Development
-

9. Platforms

Android

UI
Creation


XML
-
based

description

of

UIs


Alternatively

UI
creation

in
code


Support
of

touch
-
based

interactions


Event
-
mechanism

to

handle
interactions


E.g.
view.setOnClickListener
(
callback
)




Java.net.* APIs
can

be

used


Alternatively

HttpComponents

library

(Jakarta
Commons
)


Provided

as

part

of

Android

platform


Base
for

HTTP
conections

is

HTTPClient



Android.net.ConnectivityManager


Monitors
connectivity

state


Sends
broadcast

intent

if

connection

state

changes


Provides

methods

for

accessing

network

state

o
getActiveNetworkInfo
()

o
getAllNetworkInfo
()

o
getNetworkInfo
(
int

networkType
)

Dr. Thomas Springer

16

Application Development
-

9. Platforms

Android

Network Communication


SQLite


Local

data

base

with

SQL
and

transaction

support


Data
base

maintained

in
single

file


Base
class

android.database.sqlite.SQLiteDatabase


execute SQLite queries using the
SQLiteDatabase

query()
methods



Shared
Preferences


Base class
android.content.SharedPreferences


Store
private primitive data in key
-
value
pairs


Internal
Storage


Store
private data on the device
memory as files.


External
Storage


Store
public data on the shared external
storage as files.

Dr. Thomas Springer

17

Application Development
-

9. Platforms

Android

Persistent Storage


ContentProvider
:


Sharing
of data between applications

o
Abstraction layer on top of DB or files

(interface
android.content.ContentProvider
)

o
Content organized like on web server


content URIs for access

-
e
.g. content://de.tudrn.exampleprovider/images/content_id

o
Implement
a standard set of methods for allowing other applications
to store and retrieve data.

o
ContentProvider

implementation for common data types

o
Access via
ContentResolvers




Dr. Thomas Springer

18

Application Development
-

9. Platforms

Android

Persistent Storage

ContentProvider
query
()
insert
()
update
()
delete
()
Content Consumer
data source
(
DB
)
data source
(
files
)
openFile
()
...
Content Resolver
query
()
insert
()
update
()
delete
()
openInputStream
(
Uri
,
...)
openOutputStream
(
Uri
,

)
getContentResolver
()

Eclipse

plugin

+
Android

SDK


Project
management


Device
emulator


D
ebugger

Dr. Thomas Springer

19

Application Development
-

9. Platforms

Android

Development Tools


Google
provides

the

Android

market


Development
is

free


Transaction fee for selling applications in the android
market


30
% of the application price. For example, if you sell
your application at a price of $10.00, the fee will be
$3.00, and you will receive $7.00 in payment
.



Alternative markets allowed


E.g.
AndroidPit



at
http://www.androidpit.de

Dr. Thomas Springer

20

Application Development
-

9. Platforms

Android

App
Provisioning

IOS


iOS

(
formerly

iPhone

OS)


Created

by
: Apple Inc.


First Release: June 2007


Target
devices
:
iPhone
,
iPad
, iPod
touch
,

Apple TV


Operating System:
based

on Mach/BSD Kernel


Approach:
closed

source
,
restricted

hardware


Programming
:
Objective
-
C, C,
(C++)


Development
:
Apple Hardware: “Develop for Mac on a Mac”


Development
tools
:
Xcode

+
iOS

SDK


App
Provisioning
: App Store
maintained

by

Apple


Developer Program: Company $299/year, Individual
$99/year





Dr. Thomas Springer

22

Application Development
-

9. Platforms

iOS

Overview

Apple Hardware

Apple
iPad

UMTS, GSM, Wi
-
Fi, BT

A
-
GPS, Accelerometer, light sensor, Camera

Display 1024 x 768
px

Apple iPhone 4S

UMTS, GSM, Wi
-
Fi, BT

A
-
GPS, Compass

Accelerometer, Gyro,

Light Sensor

Display 960 x 640
px

1
st

Camera @ 5 MP

2
nd

Front
Camera

[Apple Inc.]

Dr. Thomas Springer

Application Development
-

9. Platforms

23


Created
in the early 80s by
Stepstone


Extends C with object
-
oriented constructs


Extensions

based

on Smalltalk


Objective
-
C
code

can

be

mixed

with

C
-
code



Objective
-
C
vs.
Java


Separate
files for interface (
header
-

.h)
and implementation
(.m) of
classes


No

namespaces
/
packages


Messages
to

invoke

methods


Pointer
syntax


No

method

overloading

(same
method

name
/different
parameter

type)


No

garbage

collection

(
iOS
), explicit
memory

management

required

(
supported

by

compiler
)



Dr. Thomas Springer

24

Application Development
-

9. Platforms

Objective
-
C

iOS

Architecture


Cocoa Touch
: Objective
-
C APIs
for lower
layers, e.g., multi
touch,
camera
, web
view
,
accelerometer
,...


That’s
what you use mostly!


Media
: OpenGL ES, Core Audio
,
OpenAL
, PDF, PNG, JPG, TIFF,
Quartz

2D


For

performance

optimisation


Core
Services
: Address book,
SQL
lite
,
network
,
location

services
,
threading
, NS
Object


Core
OS
: OS X Kernel, BSD,
Mach
3.0
,
file

system
,
power
management
,
security


Limited
access

for

developers

Dr. Thomas Springer

25

Application Development
-

9. Platforms

Mobile Device
Hardware
App
.
ipa
App
.
ipa
...
Media
Mach
/
BSD Kernel
Custom Frameworks
UIKit
Foundation
Core Services
Cocoa Touch

iOS

Application

Anatomy


Cocoa Touch Frameworks in
iOS
:


Foundation (NS… prefix)

o
Data types and
structures Strings, Array, Maps
,...

o
Services & functionality (Date, Calendar, Timer,...)


UIKit

o
UI related objects (“views”), pretty new



Based on design patterns:


Model
-
View
-
Controller


defines the
overall
app structure


Delegation
-

facilitates
the transfer
of information
and
data from one object to
another


Target
-
action
-

translates
user interactions with buttons
and controls into code
that
your

app

can

execute
.

Dr. Thomas Springer

Application Development
-

9. Platforms

26

Model View Controller


Model


Encapsulate

data

and

basic

behaviour


Stores
application

data

(
persistently
)


View


Present

information

to

user


Allow

users

to

edit

model

data


Controller


Mediates
access

of

views

to

models


Contains

busines

logic

for

processing

user

input


Set
-
up

and

coordination

tasks


Dr. Thomas Springer

27

Application Development
-

9. Platforms

Controller
View
Model
user action
update
update
notify
no direct interaction between
View and Model
Delegate

Design Pattern


Protocols


Similar

to

interfaces

in Java


Define

methods

that

are

to

be

implemented

by

other

class


Delegation =
mechanism

for

customization

and

notification


delegation

over

subclassing


Advantages

o
easier
switch at runtime (exchange delegate object vs. instantiation
of a different view class
)

o
Views
are

completely

reusable


View
holds

reference

to

controller

(
defined

as

Outlet)


Controller
implements

methods

of

delegate
-
protocol


View
invokes

methods

on
its

delegate

object

(
controller
)



Dr. Thomas Springer

28

Application Development
-

9. Platforms

Controller
View
will
...
should
...
did
...
will
...
should
...
did
...
delegate
Target
-
Action Design Pattern


Target
-
Action


mechanism

for

notification


Actions
represent

events

created

by

users

interacting

with

the

UI (e.g.
button

pressed
)



Controller
implements

action

handling

o
Defined

by

(
IBAction
)
actionName


View
dynamically

invokes

methods

when

actions

happen


No

return

values

(
IBAction

compiles

to

void
)



Dr. Thomas Springer

29

Application Development
-

9. Platforms

Controller
View
target
action
UIApplication
(
Singleton
)
ApplicationDelegate
<
UIApplicationDelegate
>
holds reference to delegate
id
<
UIApplicationDelegate
>
.
delegate
didFinishedLaunching
{
init ViewController
}
UIViewController
UIView
defined in
.
xib or directly
created in code
.
view
UIViewController
UIView
defined in
.
xib or directly
created in code
1
2
3
.
view
set to UIWindow

One

Screen per
ViewController


Similar

to

Android

Activities



ContainerView
-
Controller
can

control

several

ViewController

(e.g. Navigation
-
ViewController
)

Dr. Thomas Springer

30

Application Development
-

9. Platforms

iOS

Application

Anatomy

iOS Multitasking


Before
iOS

4, multitasking was limited to a selection of the
applications Apple included on the devices. Starting with
iOS

4, on 3rd
-
generation and newer
iOS

devices, multitasking is
supported through
seven background APIs
:


Background audio
-

application continues to run in the
background as long as it is playing audio or video content


Voice over IP
-

application is suspended when a phone call is
not in progress


Background location
-

application is notified of location changes


Push notifications


Local notifications
-

application schedules local notifications to
be delivered at a predetermined time


Task completion
-

application asks the system for extra time to
complete a given task


Fast app switching
-

application does not execute any code and
may be removed from memory at any time



Threads
are

supported

based

on
the

NSThread

class

Dr. Thomas Springer

31

Application Development
-

9. Platforms


Based

on Interface
Builder


.
xib

files

for

describing

view

hierarchies

(.
nib

is

binary

form)


One

.
xib

describes

typically

one

screen


Created
/
Edited

with

Interface
Builder


No

direct

manipulation

of

.
xib
/
xml


UIKit

class

library

provides

set

of

predefined

Views,
ViewControllers

and

Controls

Dr. Thomas Springer

32

Application Development
-

9. Platforms

iOS

UI
Creation

Tools for
iOS

Development:

Interface Builder


Visual editor


Assembling UI


Nib
-
file
generation


Inspectors for


Identity


Size, position and
layout


Attributes


Connections


Dr. Thomas Springer

Application Development
-

9. Platforms

33

iOS

Libraries


Root Class:
NSObject

(
defined

in
foundation

lib
)


Dr. Thomas Springer

34

Application Development
-

9. Platforms

UIKit library
NSObject
NSString
NSSet
NSArray
NSDictonary
NSNumber
NSURL
NSDate
UIView
UIViewController
UIControl
UIButton
foundation library
UIApplication

Part
of

foundation

library


NSURLConnection
,
NSURLRequest
,
NSURLMutableRequest


Dr. Thomas Springer

35

Application Development
-

9. Platforms

iOS

Network Communication


Important

connection
-
related

protocols
:


NSURLConnectionDelegate

o
Catch
errors
:

o
connection:didFailWithError
:



NSURLConnectionDataDelegate

o
connection:didReceiveResponse
:

o
connection:didReceiveData
:

o
connectionDidFinishLoading
:



Alternative:
AFNetworking

library

o
3rd
party

library

o
Provides

convenient

abstractions

for

request

creation
,
response

parsing
,
error

handling


Dr. Thomas Springer

36

Application Development
-

9. Platforms

iOS

Communication


Key
-
Value Storage


NSUserDefaults

(simple Hash
synchronized

with

file
)


Singleton


Automatically

synchronized

by

system


stored

in App
sandbox


Framework Core Data


Runtime

Objects
synchronized

with

SQLite


Abstraction

layer

for

objects


Core
data

objects

are

mapped

to

relational DB


SQLite


Files in
Sandbox


iCloud


Key
-
Value Storage (Hash)
with

automatic

synchronization

to

iCloud


Data
objects

derived

from

UIDocument
,
can

easily

be

synchronized

with

iCloud

Dr. Thomas Springer

37

Application Development
-

9. Platforms

iOS

Persistent Storage

Tools for
iOS

Development

Overview

[Apple, Inc.]

Dr. Thomas Springer

Application Development
-

9. Platforms

38

iOS

Development Tools:
XCode

Dr. Thomas Springer

Application Development
-

9. Platforms

39


IDE
for Mac and
iOS

development


Manage projects


Code editing


Building (on device & simulator)


Debugging (on device & simulator)


Repository management


Performance tuning


Tools for
iOS

Development

Instruments


Performance analysis tool
(incl. graphical display)

o
Memory usage

o
Disk activity

o
Network activity

o
Graphics performance


Dr. Thomas Springer

Application Development
-

9. Platforms

40

Tools for
iOS

Development

iOS

Simulator


Simulator for
iPhone / Retina
&
iPad

o
Choice of
iOS

versions


Dr. Thomas Springer

Application Development
-

9. Platforms

41

iOS

Developer Program

o
Company ($299/year)

o
Individual ($99/year)


o
Limited to 100 devices


Dr. Thomas Springer

Application Development
-

9. Platforms

42

WINDOWS PHONE 7


Windows Phone 7


Created

by
:
Microsoft


First Release:
September 2010


Target
devices
:
Smartphones


Operating System:
based

on
Win

CE 7


Approach
:
closed

source
,
restricted

hardware


Programming
: C#


Development:
any

hardware
, Windows


Development
tools
: Microsoft Visual Studio 2010


App
Provisioning
: App
Marketplace

maintained

by

Microsoft


Developer Program
:
99$ per year, free for
students


Dr. Thomas Springer

44

Application Development
-

9. Platforms

WP7
Overview


Hardware
from

multiple
vendors

supported


But
strict

resource

specifications


Resolution

o
480x800
or

320x480


Touch
screen


Sensors
& Services

o
GPS
,
Compass
,
Acceleration

Sensor,

Light
Sensor, WLAN, FM Radio,
Camera


Memory

o
At
least 256 MB RAM, 8GB Flash


CPU (ARMv7)

o
At

least 1
GHz


Set
of

Keys

o
Power,
volume
,
camera
, back,

start
,
search


Dr. Thomas Springer

45

Application Development
-

9. Platforms

WP7
Supported

Hardware


Applications


Several

frameworks

for

UI


All
based

on CLR


App Model


App
management
,
l
icensing
,
updates


UI Model


Shell
frame
,
session

manager
,
Direct3D,
compositor


Cloud

Integration


Bing, Location, Push
notifications
, …


Kernel


Security, Networking, Storage,
Sensor
integration


Hardware
foundation

Dr. Thomas Springer

46

Application Development
-

9. Platforms

WP7
Architecture

Mobile Device
Hardware
App
.
xap
App
.
xap
...
App Model
Hardware Foundation
Silverlight
Kernel
UI Model
Cloud
Integration
XNA
HTML
/
JavaScript
Common Language Runtime
Frameworks

App
provided

as

bundle



XAP
file

(ZIP
archive
)


DDL
with

code


Resources (
images
,
app

icon
, etc.)


Manifest
for

App
description


No

exe, App
is

executed

by

host

process


Host
process

provices

sandbox

o
Separates Apps

o
Restricts

access

to

device

resources

o
Manages

own

files

o
Manages

system

resources

for

App

Dr. Thomas Springer

47

Application Development
-

9. Platforms

WP7 App Model


Apps
are

based

on
the

.Net Compact
framework


Adapted

compared

to

Windows Mobile


UI Model
changed

completely

for

WP7



Mobile
version

of

.Net Framework


tailored

to

resource

limitations

of

mobile
devices


same
programming

model



Specific

runtime

environment


adapted

to

limited
memory
,
processing

power
and

portability



Based

on Common Language Infrastructure (CLI)


standard

for

programming

language

and

platform
-
independent

applications


binary

compatible

with

standard

.Net
framework

code


supported

languages
: C#
and

Visual Basic .Net


open
to

further

languages

which

can

be

compiled

to

CLI
-
code



Particular

layer

for

device

platform

and

operating

system

independence

WP7 App
Anatomy

Dr. Thomas Springer

48

Application Development
-

9. Platforms


2
major

building

blocks


Compact Framework Class Libraries (Common Language
Intermediary
)

o
object
-
oriented

libraries

organized

in
hierarchical

name

space

o
provides

basic

functionality

and

interfaces

for

XML
processing
, Web
services
,
and

for

developing

web
-
based

applications

o
language

independent
,
factored

into

a
series

of

DLL
files

o
only

used

libraries

are

integrated



Common Language
Runtime

(CLR)

o
comparable

with

Java VM


runtime

executes

intermediary

byte

code

o
memory

management
,
thread

management
,
security

model,
exception

handling

o
Common Type System

-
language
-
independent

type
system

-
enables

interoperability

of

different
programming

languages

and

platforms

Dr. Thomas Springer

49

Application Development
-

9. Platforms

.Net
Compact
Framework

Building

Blocks

.
Net Compact Framework
User Interface
Web Services
XML
Data
Base Classes
Execution Engine
Platform Adaptation Layer
Host Operating System
Managed
Code
Native
Code
App
1
App
2
App
3
.
Net Compact
Framework

Architecture

Common
Language
Runtime

(CLR)

Compact
Framework
Class
Libraries

Dr. Thomas Springer

50

Application Development
-

9. Platforms

.Net Compact Framework

Runtime

Environment


Common Language Runtime


executed with all applications in one process

usage of
shared memory space


managed code isolated in application domains


JIT compiler

o
transfers code to memory

o
transformation to native code


at granularity of methods
and types

o
only used code blocks are transformed and cached

o
Two compiler versions

-
IJIT


fast, generated generic code

-
SJIT


optimized for ARM processors


garbage collector

o
based on Mark
-
and
-
Sweep algorithm

o
Defragmentation

Dr. Thomas Springer

51

Application Development
-

9. Platforms

.
Net Compact Framework


Native
Code (not
available

in WP7)


provided

in
target

processor

native
code


Execution

Environment

o
Just
-
in
-
Time Compiler
transforms

CLI
-
code

to

processor

specific

code


Platform

Adaptation Layer

o
enables

independence

from

particular

OS

o
maps

OS APIs
to

.Net Compact Framework APIs


Operating System

o
.Net Compact Framework
independent

from

Windows



Managed

Code


provided

as

language

independent

byte

code


transformed

to

native
code

by

Just
-
in
-
time
compiler

at

runtime


Applications


Extension Libraries


Class Libraries

Dr. Thomas Springer

52

Application Development
-

9. Platforms

Base Class Libraries


comprise


core types, file I/O, sockets networking


reflection


globalization


localization supported



System.*, System.Collections.*


System.ComponentModel.*


System.IO.*


System.Net.Sockets.*


System.Security.*


System.Threading.*




Dr. Thomas Springer

53

Application Development
-

9. Platforms

Network, Web Services and XML


Multiple Protocol support


System.Net.Sockets class abstracts from transport protocols


TCP, UDP and HTTP supported


Standard mechanisms for encryption and authentication


Handling of IP
-
Addresses



Web Services well supported


based on Visual Studio .Net features

o
parses WSDL documents

o
generates easy
-
to
-
use client proxy classes

o
System.Net.*



XML processing


simple XML processing


XmlReader, XmlWriter


maximum performance, noncached, forward only XML reading and
writing


XML DOM


XmlDocument class


in
-
memory tree for more complex operations on document


System.Xml.*

Dr. Thomas Springer

54

Application Development
-

9. Platforms

Persistent Memory


File Access using System.IO.* classes and operations



Active Data Objects (ADO.Net)


classes for management of relational data sets


DataSets in memory can be manipulated


DataAdapters allow access two different types of data
sources



Microsoft SQL Server CE


lightweight version of SQL Server for mobile devices


uses 1MB up to 3MB memory


SQL Server in backend as master DB


Data replicated on lightweigth DB


ActiveSync component coordinates synchronization

Dr. Thomas Springer

55

Application Development
-

9. Platforms

WP7 UI
Creation


Completely

changed

in WP7


Silverlight


XNA Framework


HTML/JavaScript



Metro design


Originated

in Windows Media Center
and

Zune


Inspired

by

public

transport

signs


Objectives

o
Clean, Light, Open, Fast

o
Content, not
Crome

o
Integrated
hardware

and

software

(
integration

of

phone

keys
)

o
Soulful

and

Alive

(
personalized
,
continuously

updated
)


Style
guides

for

UI design


Dr. Thomas Springer

56

Application Development
-

9. Platforms

WP7 UI
Creation


UI Model


Based

on Silverlight 3


Subset

of


Classical

Silverlight“


Frame
contains

several

pages

for

App


Web
-
like

navigation


All
viewed

pages

on
stack

(
from

multiple
apps
)


User
can

navigate

back
and

forth

Dr. Thomas Springer

57

Application Development
-

9. Platforms

Frame
1
-
n Page
(
s
)
Content Area
Development Environment


Visual Studio
2010 Express
for

Windows Phone

Dr. Thomas Springer

58

Application Development
-

9. Platforms



Android

iOS

WP7

Vendor

Google Inc.

Apple Inc.

Microsoft

Current
Version

4.0 (
Ice

Cream
Sandwich)

5.0


7.10

Device
hardware

not restricted,
various
vendors (smartphones,
tablets)

Restricted to

Apple
devices
(iPod
, iPhone,
iPad
, Apple TV)

Various vendors,
strictly defined
hardware requirements

OS

Linux Kernel

Mach/BSD Kernel

Win

CE 7

App runtime

Dalvik VM

Native
code

on
Mach/BSD Kernel

Common Language
Runtime

Programming
Language

Java

Objective
-
C, C (C++)

C#

Open source

YES (Apache
2.0

license, some libs
excluded, e.g.

Google
Maps
)

NO

NO

Development
restrictions

Any hardware

and OS

Apple
Hardware and
OS
required

Any hardware,

Windows

Developer
program


development free

Company $299/year,
Individual $99/year

99$ per year,

free for
students

Dr. Thomas Springer

59

Application Development
-

9. Platforms

Platform

Comparision

References


Android


Arno Becker, Markus
Pant
:
Android

2


Grundlagen und
Programmierung.
Dpunkt

Verlag, 2. aktualisierte Auflage, 2010


http
://
developer.android.com


http://code.google.com/android


iOS


Cocoa

fundamentals
: http
://developer.apple.com/library/mac
/

#
documentation
/
cocoa
/
conceptual
/
CocoaFundamentals
/
CocoaD
esignPatterns
/CocoaDesignPatterns.html


Bill
Dudney
, Chris
Adamson
: Entwickeln mit dem
iPhone

SDK.
Oreilly
, 2010


Windows Phone 7


msdn.microsoft.com/de
-
de/
library
/cc656764.aspx


Ivo
Salmre
: Writing Mobile Code
-
Essential Software Engineering
for

Building

Mobile
Applications
, Addison
-
Wesley,
2005


Patrick
Getzmann
, Simon
Hackfort
, Peter Nowak: Entwickeln für
Windows Phone 7


Architektur, Frameworks, APIs, Microsoft
Press, 2011



Dr. Thomas Springer

60

Application Development
-

9. Platforms