Development Best Practices

superbshelfMobile - Wireless

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

94 views

MES903: Mobile Application
Development Best Practices

Alex Reif

Product Manager

areif@ianywhere.com

August 16, 2004

Goals


Make you aware of the differences between desktop and
mobile application development


Identify some of the interesting challenges present when
developing mobile applications



Focus will be on Pocket PC and Palm OS devices


Demo will focus on Pocket PC devices (.NET Compact
Framework)

The Enterprise. Unwired.

The Enterprise. Unwired.


Unwire

People


Unwire

Information


Manage

Information

Sybase Workspace

Industry and Cross Platform Solutions


Adaptive Server Enterprise


Adaptive Server Anywhere


Sybase IQ


Dynamic Archive


Dynamic ODS


Replication Server


OpenSwitch


Mirror Activator


PowerDesigner


Connectivity Options


EAServer


Industry Warehouse Studio


Unwired Accelerator


Unwired Orchestrator


Unwired Toolkit


Enterprise Portal


Real Time Data
Services


SQL Anywhere Studio


M
-
Business Anywhere


Pylon Family (Mobile Email)


Mobile Sales


XcelleNet Frontline
Solutions


PocketBuilder


PowerBuilder Family


AvantGo

Agenda


Introduction


Considerations


Demo: Building an Application


Best Practices Summary

Demo: CustDB

Consolidated

Database

(ASA)

Sync

Server

(MobiLink)

Pocket PC Device

Local

Database

(UltraLite)

Enterprise

CustDB

Application

Sybase

Central

The Wireless Golf Scoring Application


Platforms


Palm OS, Windows CE


Features


Team scoring for a “scramble” format tournament


Record score, player’s drive used, special holes


Local data store (UltraLite) and wireless synchronization (MobiLink)


“Poor man’s” device management


Simple messaging


Leaderboard


Database features


Common UltraLite database code


Common MobiLink synchronization scripts

Golf App
-

Palm OS Version


Golf App
-

Pocket PC Version

Agenda


Introduction


Considerations


Demo: Building an Application


Best Practices Summary

Considerations


Considerations


Device Selection


Network Issues


Application Design and Development


Data Storage


Data and Communications Security


Application Deployment and Management


Considerations


Device Selection


Network Issues


Application Design and Development


Data Storage


Data and Communications Security


Application Deployment and Management


Device Selection


Think about your users


Where will the application be used?


How will this application be used?


How often will the device be used?


Single
-
purpose or multi
-
purpose device?


What are your constraints?


Cost


Edicts from above


Current expertise


Special requirements?


Connectivity (wired or wireless)


Peripherals (printers, scanners, …)

Hardware Considerations


Power (batteries)


Processor speed


Memory


Screen


Ruggedness


Varied Screen Sizes


Desktop vs. handheld


Across handheld platforms


Move an application from Pocket PC to Palm OS


Within a platform


Pocket PC vs. CE .NET


Palm OS 4 vs. Palm OS 5

Device

Screen Resolution

IBM ThinkPad T30

1400 x 1050

Tablet PC

1024 x 768

CE .NET (NEXiO S160)

800 x 480

Pocket PC

240 x 320

Palm OS

160 x 160

Palm OS (Hi
-
Res)

320 x 320

Nokia 9290

640 x 200

Sony Ericsson P800

208 x (320 | 144 )

UI Differences
-

Input


Most devices have no keyboard


Other input methods


Touch screen with stylus


Handwriting recognition, “Graffiti”, Gestures


Virtual keyboards


Navigation pad


Jog dials


Future?


Voice recognition


Bluetooth pens




Considerations


Device Selection


Network Issues


Application Design and Development


Data Storage


Data and Communications Security


Application Deployment and Management


Network Issues


Need to learn about a new networking technology? Use it!

The Eight Fallacies of Distributed Computing


Peter Deutsch

1.
The network is reliable

2.
Latency is zero

3.
Bandwidth is infinite

4.
The network is secure

5.
Topology doesn't change

6.
There is one administrator

7.
Transport cost is zero

8.
The network is homogeneous


http://today.java.net/jag/Fallacies.html

Network Considerations
-

General


Bandwidth


What does “19.2 Kbps”
really
mean?


How much do I need now? Later?


Are there multiple “pipes” available to my application?


Availability


Does no network mean no application?


Applications should be architected in such a way that lack of network doesn’t
stop application from working


Security (or lack thereof)


Public networks can be dangerous for sensitive data


Even “private” networks can be sniffed…

Considerations


Device Selection


Network Issues


Application Design and Development


Data Storage


Data and Communications Security


Application Deployment and Management


Application Design


If you are extending a desktop application


What subset of the desktop app is feasible on a handheld device?


What subset of data does the device need?


If you are creating a new application


Determine the applications’ scope: what makes sense on the device?



Take a lesson from ergonomics…


Understand how people will use these devices


Use the device yourself


Once you know how the device will be used, you can design a better
application/UI

Application Development


Development tools


Migrating an application from desktop to mobile


Memory constraints


Building a user interface for a small screen

Development Tools


Many options, depending on platform


Pocket PC


PocketBuilder


eMbedded Visual C++, eMbedded Visual Basic


Visual Studio.NET (Compact Framework/Smart Device Extensions)


Java (Jeode VM)


Palm OS


Metrowerks CodeWarrior



Few cross
-
platform options


M
-
Business Anywhere


AppForge MobileVB/Crossfire

Migrating Applications From Desktop to Mobile


Don’t forget your current development practices: they still
apply to mobile!


Source control


Build and test environments


Etc.



What can feasibly be ported or re
-
used?


Development tool/language used


Development tools/language available


Where does your business logic reside?


Databases?


Application servers?


Does all of that logic need to be on the device?


Memory Constraints


Amount of memory available varies according to platform


New Pocket PC devices typically have >= 32 MB available


New Palm OS (non
-
entry level) devices typically have 8
-
16 MB available



Memory is shared between storage and applications



Older devices may have different constraints


Palm OS device with 2 MB of memory has < 36 KB of heap space available!



User Interface Design


Good UI is very important


More important than on the desktop?


Handheld != desktop


No keyboard


Small screen


Platform differences


How do you squeeze lots of information onto a small screen?


Tab controls, menus, etc.


Iterative development


Keep application logic separate from GUI!


This helps when porting to other platforms

Considerations


Device Selection


Network Issues


Application Design and Development


Data Storage


Data and Communications Security


Application Deployment and Management


Data Storage


Any mobile enterprise application will need to store at least
some data on the device



How will you store this data?


How much on
-
device data does your application require?


How much now?


How much later?


How much on
-
device data manipulation will occur?


Do you need to synchronize on
-
device data with an
enterprise data source?

Other Mobile Data Storage Options


Proprietary APIs


Palm DB, flat file



Custom
-
coded solutions


Customer built data structures, searching, sorting, and synchronization


‘Shrunk
-
down’ enterprise database


Vendor reduces capabilities of enterprise database to make it fit on small
devices

Other Mobile Data Storage Limitations


Proprietary APIs



One table per ‘database’


Poor performance


Limited capabilities


Custom
-
coded solutions


Very resource intensive


Increased risk


Increased maintenance costs


‘Shrunk
-
down’ enterprise database


Pre
-
chosen limited functionality


Architecture not geared for mobile and wireless devices

UltraLite


“Small
-
fingerprint” database in SQL Anywhere Studio


High
-
performance mobile data store


Data synchronization with the enterprise (MobiLink)


Aimed at small, mobile, embedded and wireless devices


Personal organizers, smart phones, etc.


Point
-
of
-
sale devices


Typical constraints


No hard disk


Limited memory


Slow processors


Limited power


Wireless connection

Considerations


Device Selection


Network Issues


Application Design and Development


Data Storage


Data and Communications Security


Application Deployment and Management


Data and Communications Security


General observations


Costs must be compared to cost and risk of security breech


No solution is perfect


Security is reducing risk, not eliminating risk


If security is cumbersome, it will likely be circumvented


User education is important



What security problem are you trying to solve?


Interception of data transmission


Loss of device


User authentication




Considerations


Device Selection


Network Issues


Application Design and Development


Data Storage


Data and Communications Security


Application Deployment and Management


Application Deployment and Management


Cost of mobile and remote computing


Expensive application & update rollouts


Significant assets (software/hardware) not tracked


Cost of support


Direct support center costs and lost productivity


Employees can’t function without devices


mission critical


Security risks


Mobile / remote / embedded operation outside the firewall


Risk when devices are corrupted or lost


Update/enforce virus protection, OS, software configuration


Desktop management solutions don’t fit


Not suited to the mobile environment


Complexity, footprint, connection flexibility, device diversity

XcelleNet Frontline Solutions


XcelleNet: Afaria and RemoteWare


MES913 Managing and Securing Frontline Devices: An XcelleNet Overview


http://www.xcellenet.com


Agenda


Introduction


Considerations


Demo: Building an Application


Best Practices Summary

UltraLite and the .NET Compact Framework


We’re going to create and deploy an application from scratch


Developed using Visual Studio.NET


UltraLite for data storage


MobiLink for data synchronization



Application: Survey application


Data
-
driven: questions and response choices all in database


Signature capture


Runs on Pocket PC devices



First, let’s see the completed application…


Demo: Survey Application

Consolidated

Database

(Sybase/Oracle/

Microsoft/IBM)

MobiLink

Device

UltraLite

USM

Enterprise

TCP/IP

HTTP

HTTPS

HotSync

(wired or wireless)

Survey

Application

(.NET)

.NET

Compact

Framework

UltraLite


“Small
-
fingerprint” database in SQL Anywhere Studio


High
-
performance mobile data store


Data synchronization with the enterprise (MobiLink)


Aimed at small, mobile, embedded and wireless devices


Personal organizers, smart phones, etc.


Point
-
of
-
sale devices


Typical constraints


No hard disk


Limited memory


Slow processors


Limited power


Wireless connection

Goals of UltraLite


Provide advantages of an enterprise database


Transaction processing, data types (including numeric and date/time),
referential integrity, indexing, strong encryption


Provide synchronization to industry standard enterprise
databases (robust and secure)


Maintain extremely small footprint


Maintain hand
-
coded speed


Reduce the requirement for platform specific knowledge

UltraLite Programming Interfaces


UltraLite Components


Set of components to enable UltraLite development with various development
tools


UltraLite.NET


AppForge MobileVB/Crossfire


Microsoft eMbedded Visual Basic


Native UltraLite for Java


UltraLite for M
-
Business Anywhere


UltraLite C++ Component


UltraLite ODBC


Sybase PocketBuilder



“Classic” UltraLite


Embedded SQL


C++ API


JDBC

UltraLite.NET


.NET wrapper for UltraLite Component API


All .NET languages supported


Platform support


Pocket PC (.NET Compact Framework)


Windows XP (Tablet PC
-

desktop .NET Framework)


Namespace is iAnywhere.UltraLite



SQL928 Building Hand
-
held Database Applications Using
UltraLite


Wednesday, 3:30 PM, Captiva 2


UltraLite Schema Files


Schema file (.usm file)


Provides schema information for a new database


Can be used to “upgrade” an existing database



Schema files can be created with:


Existing ASA database (ulinit)


XML file (ulxml)


UltraLite Schema Painter GUI tool (ulview)

Demo: Create an UltraLite Schema

question
person
response
person
i d
name
signature
binary(16)
varchar(20)
varbinary(512)
<pk>
question
i d
text
integer
varchar(128)
<pk>
response
question_id
i d
text
integer
integer
varchar(30)
<pk,fk>
<pk>
survey
person_id
question_id
response_id
binary(16)
integer
integer
<pk,fk1>
<pk,fk2>
<fk2>
Demo: Create an UltraLite Schema

Consolidated

Database

(Sybase/Oracle/

Microsoft/IBM)

MobiLink

Device

UltraLite

USM

Enterprise

TCP/IP

HTTP

HTTPS

HotSync

(wired or wireless)

Survey

Application

(.NET)

.NET

Compact

Framework

UltraLite Components
-

Class Hierarchy

DatabaseManager

Connection

DatabaseSchema

PublicationSchema

SyncResult

SyncParms

Table

Column

TableSchema

PreparedStatement

ResultSet

ResultSetSchema

ColumnSchema

IndexSchema

ConnectionParms

Demo: UltraLite.NET in the Compact Framework

Consolidated

Database

(Sybase/Oracle/

Microsoft/IBM)

MobiLink

Device

UltraLite

USM

Enterprise

TCP/IP

HTTP

HTTPS

HotSync

(wired or wireless)

Survey

Application

(.NET)

.NET

Compact

Framework

What is MobiLink?


A two
-
way synchronization technology for large scale mobile
database deployment


Remote database (mobile, embedded, or workgroup database server)


Consolidated database (enterprise, workgroup, or desktop database)


A server that processes synchronization requests from
remote databases



Synchronization Streams


Pocket PC: TCP/IP, HTTP


Palm OS: TCP/IP, HTTP, HotSync


128
-
bit strong encryption of synchronization stream supported using Certicom
TLS


What is MobiLink?

Consolidated
Database
Communication Infrastructure
( Internet / Dial-up / Wireless )
Data
Data
Data
Data
Data
MobiLink
Data
Data
Mobile or Remote Databases
MobiLink Design Goals


Heterogeneous consolidated database


Scalable and robust (tens of thousands)


Manageable in large deployments


Support handheld and wireless devices


Flexible

MobiLink Consolidated Databases


Oracle 8, 8i, 9i


Microsoft SQL Server


IBM DB2 UDB


Adaptive Server Enterprise (ASE)


Adaptive Server Anywhere (ASA)



List of Recommended ODBC Drivers


http://www.ianywhere.com/developer/technotes/odbc_mobilink.html

Adding Synchronization


Set properties of Connection.SyncParms

myConn.SyncParms.UserName = “sync_user”

myConn.SyncParms.Stream = StreamType.TCPIP

myConn.SyncParms.Version = “sync_version”


To synchronize:

myConn.Synchronize


Status will be in Connection.SyncResult



Template sync forms need two extra lines of code:

Dim pd As SyncProgressDialog =




New SyncProgressDialog(dbMgr, myConn)

pd.ShowDialog()


Demo: Add Synchronization

Consolidated

Database

(Sybase/Oracle/

Microsoft/IBM)

MobiLink

Device

UltraLite

USM

Enterprise

TCP/IP

HTTP

HTTPS

HotSync

(wired or wireless)

Survey

Application

(.NET)

.NET

Compact

Framework

Demo Summary

Consolidated

Database

(Sybase/Oracle/

Microsoft/IBM)

MobiLink

Device

UltraLite

USM

Enterprise

TCP/IP

HTTP

HTTPS

HotSync

(wired or wireless)

Survey

Application

(.NET)

.NET

Compact

Framework

Agenda


Introduction


Considerations


Demo: Building an Application


Best Practices Summary

Best Practices


Always think ahead


Don't forget about your current development practices


Use the devices and the networks to learn them


Don't forget about security


Figure out which part(s) of your application make sense for
the device


A good UI is very, very important


Use a local data store



Test!


iAnywhere at TechWave2004


Ask the iAnywhere Experts on the Technology Boardwalk (exhibit
hall)


Drop in during exhibit hall hours and have all your questions answered by our technical
experts!


Appointments outside of exhibit hall hours are also available to speak one
-
on
-
one with our
Senior Engineers. Ask questions or get your yearly technical review


ask us for details!



TechWave ToGo Channel


TechWave To Go, an AvantGo channel providing up
-
to
-
date information about TechWave
classes, events, maps and more


also, keep up to date with the TechWave Newsletter


now available via your handheld device!


www.ianywhere.com/techwavetogo



Mobile and Wireless Email using Pylon Anywhere


iAnywhere is providing access to your corporate email at TechWave using Pylon
Anywhere. You can keep up
-
to
-
date with your latest email, calendar, contacts, and tasks
from your PDA or any Web
-
client! Visit the iAnywhere demo station in the Sybase booth
or our “Ask the Experts” area in the Technology Boardwalk (Exhibit Hall) for details on
how you can evaluate Pylon Anywhere yourself!


iAnywhere at TechWave2004


Wi
-
Fi Hotspots


brought to you by Intel


You can enjoy wireless internet access via Wi
-
Fi hotspots provided by Intel. Using either
a laptop or PDA that is Wi
-
Fi 802.11b wirelessly
-
enabled, visitors can access personal
email, the internet and “TechWave ToGo”



Developer Community


A one
-
stop source for technical information!



Access to newsgroups,new betas and code samples


Monthly technical newsletters


Technical whitepapers,tips and online product documentation


Current webcast,class,conference and seminar listings


Excellent resources for commonly asked questions


All available express bug fixes and patches


Network with thousands of industry experts



http://www.ianywhere.com/developer/


Questions?

Alex Reif

Product Manager

areif@ianywhere.com