Sie sind auf Seite 1von 22


Mobile Application Development

Three Tier-Mobile Application Architecture

A mobile application will normally be structured as a multi-layered application consisting of
user experience, business, and data layers. When developing a mobile application, you may
choose to develop a thin Web-based client or a rich client...

Mobile Application Pocket Guide v1.1

Microsoft patterns & practices 8
The following design guidelines provide information about different aspects you
shouldConsider when designing a mobile application.
Mobile Application Development

• Decide if you will build a rich client, a thin Web client, or rich Internet application (RIA). If
your application requires local processing and must work in an occasionally connected
scenario, consider designing a rich client. A rich client application will be more complex to
install and maintain. If your application can depend on server processing and will always be
fully connected, consider designing a thin client. If your application requires a rich user
interface (UI), only limited access to local resources, and must be portable to other
Platforms, design an RIA client.

• Determine the device types you will support. When choosing which device types to
support, consider screen size, resolution (DPI), CPU performance characteristics, memory
and storage space, and development tool environment availability. In addition, factor in user
requirements and organizational constraints. You may require specific hardware such as
GPS or a camera and this may impact not only your application type, but also your device

• Design considering occasionally connected limited-bandwidth scenarios when required.

Ifyour mobile device is a stand-alone device, you will not need to account for connection
issues. When network connectivity is required, Mobile applications should handle cases
when a network connection is intermittent or not available. It is vital in this case to design
your caching, state management, and data-access mechanisms with intermittent network
connectivity in mind. Batch communications for times of connectivity. Choose hardware
andsoftware protocols based on speed, power consumption, and ―chattiness,‖ and not just
on ease of programming.

• Design a UI appropriate for mobile devices, taking into account platform constraints.
Mobile devices require a simpler architecture, simpler UI, and other specific design decisions
in order to work within the constraints imposed by the device hardware. Keep these
constraints in mind and design specifically for the device instead of trying to reuse the
architecture or UI from a desktop or Web application. The main constraints are memory,
battery life, ability to adapt to difference screen sizes and orientations, security, and network

• Design a layered architecture appropriate for mobile devices that improves reuse
andmaintainability. Depending on the application type, multiple layers may be located on the
device itself. Use the concept of layers to maximize separation of concerns, and to improve
Mobile Application Development

reuse and maintainability for your mobile application. However, aim to achieve the smallest
footprint on the device by simplifying your design compared to a desktop or Web application.
• Design considering device resource constraints such as battery life, memory size,
andprocessor speed. Every design decision should take into account the limited CPU,
memory, storage capacity, and battery life of mobile devices. Battery life is usually the most
limiting factor in mobile devices.
Mobile Client Frame
There are several common issues that you must consider as your develop your design.
These issues can be categorized into specific areas of the design. The following table lists
the common issues for each category where mistakes are most often made.
Data Layer Components
• Data access logic components. Data access components abstract the logic necessary
toaccess your underlying data stores. Doing so centralizes the data access functionality,
whichmakes the application easier to configure and maintain.

• Data helpers / utilities. Helper functions and utilities assist in data manipulation, data
Transformation and data access within the layer. They consist of specialized libraries
and/orcustom routines especially designed to maximize data access performance and
reduce thedevelopment requirements of the logic components and the service agent parts of

• Service agents. When a business component must use functionality exposed by an

externalservice, you might need to create code that manages the semantics of
communicating withthat service. Service agents isolate your application from the
idiosyncrasies of calling diverseservices, and can provide additional services such as basic
mapping between the format ofthe data exposed by the service and the format your
application requires.

Business Layer
Business Components
The following list explains the roles and responsibilities of the main components within
thebusiness layer:
• Application façade (optional). An application façade combines multiple business
operationsinto a single message-based operation. You might access the application façade
from thepresentation layer by using different communication technologies.
Mobile Application Development

• Business components. Within the business layer there are different components that
Provide business services, such as processing business rules and interacting with data
accesscomponents. For example, you might have a business component that implements
thetransaction script pattern, which allows you to execute multiple operations within a
singlecomponent used to manage the transaction.

• Business entities. Business components used to pass data between other components
areconsidered business entities. The data can represent real-world business entities, such
asproducts and orders, or database entities, such as tables and views. Consider using
scalarvalues as business entities.

• Business workflows. Many business processes involve multiple steps that must be
Performed in the correct order and orchestrated. Business workflows define and
coordinatelong-running, multi-step business processes, and can be implemented using
businessprocess management tools.

Presentation layer
The following steps describe the process you should adopt when designing the presentation
Layer for your application. This approach will ensure that you consider all of the relevant
factorsas you develop your architecture:
1. Identify your client type. Choose a client type that satisfies your requirements and
adheresto the infrastructure and deployment constraints of your organization. If your
mobiledevices users will be intermittently connected to the network, a mobile rich client
isprobably your best choice.
2. Determine how you will present data. Choose the data format for your presentation
layerand decide how you will present the data in your UI.
3. Determine your data-validation strategy. Use data-validation techniques to protect
yoursystem from untrusted input.
4. Determine your business logic strategy. Factor out your business logic to decouple it
fromyour presentation layer code.
5. Determine your strategy for communication with other layers. If your application
hasmultiple layers, such as a data access layer and a business layer, determine a strategy
forcommunication between your presentation layer and other layers.
Mobile Application Development

Model View Controller Architecture

Mobile Application Development
Mobile Application Development

Information Access Devices

Mobile Application Development

PDA and Smart Phones:

A PDA is a small handheld device that provides digital organization functions. PDAs
were originally designed to replace paper for organizing calendar and contact
functions. As such, early devices contained address books, calendars and notepads.
Today, PDAs supplement this functionality with wireless connectivity and e-mail. A
typical PDA consists of a small liquid crystal display, an operating system, a processor
and memory.

Most standard PDAs include a variety of application software, such as games, music
players, and spreadsheet and word processing products. The devices can not only
synchronize with desktop PCs, but can also connect directly with server applications to
access Web content and Web applications.

To appeal to business users, independent software vendors offer sophisticated

business applications like business intelligence, collaboration, customer relationship
management, data collection, field service, sales force automation, supply chain
management and others. Developers need to note that with the exception of
Microsoft's offering, all of the operating system platforms listed rely heavily on third-
party tools for development.

PDAs, which are data-centric devices, are available in two form factors: tablet and
clamshell. There is another category of mobile devices: smart phones. These are
actually cellular phones with some PDA functionality.

Generally speaking, the market-leading embedded operating systems — including

Palm OS and Microsoft Windows Mobile — as well as a number of Linux-based
operating systems can run on both PDAs and smart phones. Symbian OS and
Microsoft's Windows Mobile-based Smartphone platform are geared to mobile phone

Tablet PDAs

Tablet PDAs are palm-sized devices with a stylus and a touch screen. They typically
have a display between 50 mm and 100 mm (2 inches to 4 inches) diagonally and
weigh between 100 grams and 220 grams (3.5 to 8 ounces). They feature either a
QWERTY keyboard or stylus-operated software keyboard for data input.
Mobile Application Development

Examples of tablet PDAs include Palm Zire and Tungsten models, Sony Clié and
Microsoft Pocket PC-based devices. Also included in the Tablet PDA category are
some industrial handhelds, such as the Intermec 700 Series, Symbol PPT 8800 and
Panasonic Toughbook CF-P1.

Clamshell PDAs

Clamshell PDAs usually include a small keyboard, a stylus and a touch screen. Form
factor and display size vary substantially. Data input is not significantly easier than with
tablet PDAs, as the small keyboard requires nimble fingers.

Examples of clamshell PDAs include the Sony Clié PEG NX80 and Sony Clié UX50,
Sharp Zaurus C-760 and T-Mobile Sidekick. Clamshell PDAs have a closed face.

Wireless Subcategory of PDAs

A sub classification includes tablet and clamshell PDAs that are natively wireless-
enabled. Wireless PDAs offer integrated wireless LAN or WAN communication
capabilities, but Bluetooth alone does not satisfy our definition. Examples of wireless-
enabled tablet PDAs include the Research in Motion (RIM) Blackberry 7200 Series,
Toshiba Pocket PC e800, Hewlett-Packard (HP) iPAQ h5550 and 02 Xda.

Wireless PDAs are distinguished from smart phones by their form factor and primary
purpose. Wireless PDAs are mainly data-centric, while smart phones are voice-centric
devices. PDAs that use add-on modules to achieve wireless capabilities are still
classified as they were at the time they left the factory, so a stand-alone PDA that has
been enhanced with a wireless General Packet Radio Services (GPRS) module is still
considered a stand-alone PDA.


Where a PDA is a data-centric device, a Smartphone is a voice-centric device. Its

primary functionality is voice communication; data is only a secondary feature. This is
reflected, in most cases, in its handset-like form factor. While one typically needs both
hands to operate a PDA, smart phones are generally designed for one-handed
operation, offer smaller displays, have greater battery life and are usually smaller in
size and weight.
Mobile Application Development

Both PDAs and smart phones rely on full-featured operating systems with ample third-
party software support. Smartphone’s have rich telephony features with some data

The most common applications included in a Smartphone are calendar, address book,
text messaging, wireless Internet connectivity, PC synchronization and "to-do" list. It is
often possible to expand storage through cards, such as Secure Digital or others.
Features, such as integrated digital cameras, multimedia messaging and Motion
Picture Experts Group (MPEG) Audio Layer 3 (MP3) players, are also increasingly

Examples of smart phones on the market today include the Orange SPV E200
(manufactured by HTC), the Nokia 3660, the Sony Ericsson P900, the palmOne Treo
600 and the Motorola MPx200.

PDA Operating System

Operating systems for highly portable computing devices should have the following

 They must be small — typically a few megabytes — so as not to consume

valuable storage space.
 They should consume very little power to support long battery life. Battery life
can be one of the main constraints of PDAs. Batteries for stand-alone PDAs
last between four and 12 hours of continuous usage. However, batteries in
wireless-connected PDAs and smart phones last only between two and 10
hours of talk time.
 They should support a high degree of task switching, allowing users to switch
smoothly from one program to another.

Palm OS

 Palm Source, the software spin-off from Palm, released Palm OS 5 in 2002
with a significant shift in its architecture. Previous versions of Palm OS ran on
Motorola DragonBall 68000 processors. The operating system itself was
created around the multithreaded AMX real-time operating system from
Canadian Kadak. However, the license with Kadak limited the company's ability
Mobile Application Development

to expose multitasking to software developers because it only permitted a

single-threaded subset of AMX.
 The Palm OS 5 operating system has a new multiprocessing kernel without
licensing restrictions. It is designed to operate on ARM-compliant processors,
which run anywhere from two to 30 times faster than 68000 processors. Aside
from hardware speed, the shift in architecture also allows Palm-driven devices
to run 32-bit applications. With ARM support, Palm Source gives licensees the
options to create a variety of devices at different price points.
 To accommodate backward compatibility, Palm created PACE, which
translates 68,000 instructions to 32-bit ARM and adjusts bit-ordering
inconsistencies. This allows for Palm OS 4 applications to run transparently
under Palm OS 5. Early reviews on the emulation process are mixed.
Degradation in performance for some applications has been noticed, while
other applications reported faster performance.
 Palm OS 5 is a multithreading operating system. It provides native support for
wireless technology (802.11b, Bluetooth, code division multiple access
[CDMA], Global System for Mobile Communications [GSM], and 2.5 and third-
generation [2.5G/3G]) mobile networks and offers 128-bit SSL encryption
services (SSL 3.0/TLS 1.0). Through a partnership with RSA Security, Palm
OS 5 includes Rivest Code 4 (RC4), Secure Hash Algorithm 1 (SHA-1) and
signature verification using RSA-verify. Other cryptographic architectures, like
Advanced Encryption Standard (AES), can be plugged into the Palm OS


 The Symbian OS is targeted at the Smartphone market. It is based on a 32-bit

multitasking kernel and provides middleware for communications, data
management and graphics, a graphical user interface framework and
application engine. Symbian OS runs natively on the ARM RISC processor and
is designed with the real-time capability to support both voice and data
applications over wireless networks. It supports serial, infrared and Bluetooth
connections, as well as a telephony API that enables clients to initiate, receive,
control and terminate data, fax and voice calls using the same methods for any
hardware. Like Palm OS and Windows Mobile, Symbian OS has its own
synchronization code (Symbian Connect) that lets a PDA or Smartphone
Mobile Application Development

exchange data between its personal information management (PIM)

applications and PC applications.
 Symbian 7.0, released in February 2003, includes support for multimode and
3G mobile phones. It supports IPv6 and IPsec technologies, giving mobile
phones the capability to communicate securely on a peer-to-peer basis.
Symbian 7.0 also adds Java J2ME MIDP 2.0, which extends the capabilities of
phone devices to run Java applications and services geared exclusively to
mobile phones.
 The vast majority of developers for Symbian will use Java and C/C++, although
a niche programming language initiative (OPL) is also supported and available
for open source development. An alpha version of OPL for Nokia's Series 60
on Symbian OS 6.1 is already available. The UIQ interface first appeared on a
Symbian 7 phone with the Sony Ericsson P800 in September 2002. The UIQ
interface is also found on other Symbian 7 phones, such as the Motorola A920,
BenQ P30 and Sony Ericsson's P900.
 Microsoft is the most challenging competitor to Palm Source for PDA
operating systems. Windows Mobile 2003 is based on the Windows CE 4.2
operating system, which was upgraded to include built-in support for Wi-Fi and
Bluetooth. New imaging and media functionality is added through Pictures, an
application that allows users to display, edit and store digital photos, and
Media Player 9, which offers improved audio and video capabilities along with
support for broadband content streaming.

Windows Mobile 2003 comprises three software profiles:

 Windows Mobile 2003 software for Pocket PCs, supporting stand-alone and
wireless LAN integrated PDAs. The Pocket PC software includes a one-
quarter Video Graphics Array (QVGA) screen resolution (240 × 320 pixels)
with 65,000 colors. It offers multiple options for text input, including
handwriting software that Microsoft has licensed from Vadim (Calligrapher).
 ActiveSync 3.7 provides synchronizing with the desktop for Pocket PC
devices. It provides two levels of security that allow users to set a simple four-
digit personal identification number (PIN) or a full Windows 2000-level strong
alphanumeric password. Pocket PC is based on a real-time preemptive
multitasking embedded operating system.
Mobile Application Development

 Windows Mobile software for Pocket PC Phone Edition, which supports PDAs
with integrated telephony features. It offers such telephony applications as
caller ID, conference calling, speed dial and SMS and is based on the same
kernel and specifications as Windows Mobile 2003 software for Pocket PCs.
 Windows Mobile software for Smartphone’s, for use with mobile phones
combining wireless voice and data communications. Microsoft Smartphone is
targeted for use with mobile phones designed for one-handed navigation and
a smaller display. Microsoft makes Smartphone software available for both
GSM/GPRS and CDMA/single carrier radio transmission technology (1xRTT)

Linux-Based Mobile Operating Systems

There are currently a number of commercial and noncommercial implementations of

embedded Linux for PDAs and other handheld devices. Using Linux on PDAs and
smart phones has advantages: it is able to support sophisticated applications and
offers licensees the advantage of eliminating or reducing OS licenses fees.

There are many adaptations of Linux for embedded devices. Such diversity, however,
could be the main obstacle to the success of Linux in the commercial mobile device
market. No Linux PDA or Smartphone vendor sets standards on key elements, such
as user interface, PIM, power management and synchronization. The result is limited
compatibility among different products. Sharp is the dominant vendor of Linux-based

Metroworks Embedix

Embedix, initially offered by Lineo, was one of the first embedded Linux operating
systems. It is specifically designed to handle the unique speed, memory and storage
requirements of embedded devices. It runs on such devices as PDAs, smart handheld
devices, residential gateways and digital TVs.
Mobile Application Development

Embedix supports a broad range of processor platforms, including x86, PowerPC,

ARM and MIPS. In December 2002, Motorola's embedded subsidiary, Metrowerks,
acquired Embedix.

Midori Linux

Created by Transmeta, Midori Linux is an open-source operating system for small

devices. Transmeta released Midori Linux to the open-source community in 2001
under the GNU General Public License (GPL). Midori includes a build system, a Linux
kernel with memory- and storage-conserving features, and system-level support for
running normal Linux software.

It also supplements the Linux kernel with such embedded-oriented features as both
Flash ROM- and RAM-based file systems and boot/runtime that can run from Flash
ROM. It offers power management features that are optimized for Transmeta's Crusoe
processor line.

MontaVista Linux

MontaVista Software offers several editions of its embedded Linux operating system
for a range of applications. The MontaVista Linux Consumer Electronics Edition 3.0 is
geared for consumer devices. In March 2003, MontaVista Linux was selected as the
operating system for Motorola's upcoming A760 smartphone. Motorola's device
integrates digital camera, Internet, messaging, multimedia, and PDA and telephony
capabilities. It is currently available in China. The operating system is designed for use
with IBM PowerPC 405LP Arctic II/III and Texas Instruments Open Multimedia
Applications Platform (OMAP) digital processor chips.

Smart Cards

Smart Card is a plastic card with an embedded microprocessor and a memory large enough
to store programs made by the card-issuing company. The exact structure of a smart card is
specified by internationalstandards: the plastic card must have dimensions of 85.60mm x
53.98mm x 0.80mm and must be able to bend a specified amount without damage for

A printed circuit and an integrated circuit chip (microcontroller) are embedded on the card.
As silicon cannot handle bending very well, the chip must be very small. The printed circuit is
Mobile Application Development

a thin gold plate that provides electrical contacts to the outside world and also protects the
chip from mechanical stress and electrical static.

In 1975, the first card in the credit-card format with the chip and its contacts on one side was
made by the French company CII-Honeywell-Bull. Its first customer orders were shipped two
years later.

All Smart Cards have memory and a processor, but some are almost exclusively the former.
These 'memory cards' are not the subject of this site as they aren't very 'smart'.

Smart Cards do not have an internal power source but need power to operate. Therefore
they only operate when in the presence of a Card Accepting Device (CAD) which supplies
their power requirements. Most Smart Cards come into physical contact with CADs while
others do not. However, they have practically the same architecture and will not be
distinguished in this site.

A fundamental change in Smart Cards is in the language they are programmed. In a manner
analogous to the development of computer systems, there has been a move from assembly
language to higher level languages, especially Java.

Smart Card Architecture

Smart Cards are thin cards with an embedded chip, and this automatically poses its own
unique challenges of architectural design. However, it turns out that the solutions tend to be
a scaling down of conventional chips rather than inventing an all-new chip.
Mobile Application Development

Central Processing Unit

Traditionally this is an 8-bit microcontroller but increasingly more powerful 16 and 32-bit
chips are being used. However, none have multi-threading and other powerful features that
are common in standard computers. Smart Card CPUs execute machine instructions at a
speed of approximately 1 MIPS. A coprocessor is often included to improve the speed of
encryption computations.

Memory System
There are three main types of memory on cards:

 RAM. 1K. this is needed for fast computation and response. Only a tiny amount is
 EEPROM (Electrically Erasable PROM). Between 1 to 24K. Unlike RAM, its contents
are not lost when power is. Applications can run off and write to it, but it is very slow
and one can only read/write to it so many (100 000) times.
 ROM. Between 8 to 24K. The Operating System and other basic software like
encryption algorithms are stored here.

This is via a single I/O port that is controlled by the processor to ensure that communications
are standardized, in the form of APDUs (A Protocol Data Unit).

Here is a selection of parameters from some of the smart cards on the market today. They
are neither the biggest nor the fastest; that is reserved for Java cards. The reason for this is
price --- smart cards like these are programmed in assembly language and do not need
much in the way of resources. To keep down costs, they don't get resources.
Mobile Application Development

Word Write/erase Transmission

Smart Card ROM EEPROM RAM Voltage Clock
size cycles rate

Infineon SLE 2.7 - 5

8-bit 9K 1K 256b 500 000 9600 baud
44C10S 5.5V MHz

4.7 -
Orga ICC4 8-bit 6K 3K 128b 10 000

4.5 - 13.6
GemCombi 8-bit 5K 100 000 106 kbaud
5.5V MHz

DNP Risona 8-bit 1K 5V 9600 baud

AmaTech 13.6 100 000

8-bit 1K 5V
Contactless MHz cycles

Schlumberger 8/16- 1-5 100 000

8K 16K 256b 5V 9600 baud
Cyberflex bit MHz cycles

Types of Smart Card

Smart cards are defined according to 1). How the card data is read and written 2). The type
of chip implanted within the card and its capabilities. There is a wide range of options to
choose from when designing your system.
Mobile Application Development

Application Development for the iPhone and the Android OS


• Need Java 5.0+

• Easiest to use Eclipse 3.3.1+
• Download SDK starter pack from and invoke SDK
Setup program
• Install Eclipse plug-in
Help, Install New Software
Android Development Tools
• Tell Eclipse where Android is located
• Windows, Preferences, Android

Hello Android

 Eclipse File, New, Project,

 Android, Android Project
 Create Android Virtual Device (AVD)
 Window, Android SDK, AVD Manager
 Run (on emulator)
 To run on phone enable USB debugging
 Settings, Applications, USB Debugging
 Install USB driver (Windows only)
Android App Framework

Created by default

• src -- -- main Activity

• res, drawable -- icon.png – app’s icon
• res, values -- strings.xml – constants
• res, layout – main.xml -- screen layout
Mobile Application Development

• AndroidManifest.xml – table of contents

• gen – – references, never touch it
OpenGL (from Hello Android)
• Rotating cube
• Uses OpenGL ES (embedded systems)
• Draws cube from vertices
• Uses GLRenderer
onSurfaceCreated -- set properties
onSurfaceChanged – update view
onDrawFrame – draw the scene
Browser View (from Hello Android)
• An EditText and Button above WebView
• WebView uses loadUrl method to display web page
Documentation –
Mobile Application Development
Mobile Application Development

• Needs Intel Mac, OS X 10.5.4+
• Download SDK and register (free)
• $99 to deploy to iPhone or iPod
• Uses Objective-C
• Launch XCode
• Examples from iPhone SDK Development
Hello iPhone
• File, New Project in XCode
• Choose View-based Application
• HelloViewController class and HelloViewController.xib (nib), freeze-dried GUI
• HelloAppDelegate manages application
• Use Interface Builder to add Label and configure color and size in Attributes
Hello User
• Allow user to enter a name
• IBOutlet – reference from code to nib object, e.g. label, text field
• IBAction – method nib’s objects can call, e.g. button press handler
• In Interface Builder, connect outlets to code, connect action Touch Up Inside event to
handler method, sayHello
• Implement the sayHello handler method
Movie – MVC
• Create Movie class (the model)
• Labels with movie info, Edit button
• MovieEditorViewController for edit view with Done button to return to main screen
• Send message in Edit button to start movie controller
• Send message in Done button to return to MovieViewController
Mobile Application Development

1. Uwe Hansmaan et al, ―Principles of Mobile Computing‖, Springer, 2003.
2. Hello Android, Third Edition, Ed Burnette, Pragmatic Programmers, 2010.
3. Introduction to Android development Using Eclipse and Android widgets
4. Works
5. IPhone SDK Development, Bill Dudney and Chris Adamson, Pragmatic
Programmers, 2009.
6. Beginning iPhone Games Development, PJ Cabrera, et al, Apress, 2010.
7. Developing Apps for iOS (video and pdf) from Stanford University