MES905:  Building Mobile Web Applications with SQL Anywhere
1 / 53

MES905: Building Mobile Web Applications with SQL Anywhere - PowerPoint PPT Presentation

  • Uploaded on

MES905: Building Mobile Web Applications with SQL Anywhere. David Loop Principle Consultant [email protected] August 15-19, 2004. The Enterprise. Unwired. The Enterprise. Unwired. Industry and Cross Platform Solutions. Manage Information. Unwire Information. Unwire People.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' MES905: Building Mobile Web Applications with SQL Anywhere' - indra

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

MES905: Building Mobile Web Applications with SQL Anywhere

David Loop

Principle Consultant

[email protected]

August 15-19, 2004

The enterprise unwired1
The Enterprise. Unwired.

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

Sybase Workspace

Mobile always available applications
Mobile “Always Available” Applications

  • Extend enterprise information to mobile workers on demand

  • Mobile workers need to be productive anywhere, anytime

    • Wireless access is not 100% (underground, countryside, restricted areas)

  • “Always available” model leverages:

    • Local Data Store

    • Accesses important/frequent information offline

    • Synchronize when necessary

    • Increases batterly life and performance

    • Saving on connection costs

  • Enterprise Information

    • Interface with enterprise systems for data and access

    • Appy and enforce existing enterprise security standards

Challenges to mobile web applications
Challenges to Mobile Web Applications

  • Mobilize Enterprise Data

  • Security

  • Performance

  • Reliability

  • Development Effort

  • Deployment Effort

  • Cost

But these are not specific to Mobile Web Applications

Real challenges to mobile web applications
Real Challenges to Mobile Web Applications

  • Mobile application adoption, usability

  • Enterprise integration and access

  • Enterprise security

    • device, transmission and authentication

  • Distributed application logic

  • Device characteristics

    • form follows function

  • Device disparity

  • Distributed and mobile deployment

  • Re-deployment and healing

  • Development learning curve

Why mobile applications with m business anywhere
Why Mobile Applications with M-Business Anywhere?

  • Delivers web content and web applications

  • Web developers leverage their existing skill sets with open standards

    • rapid development

    • low cost of ownership

    • rich environment

  • Dynamic Mobility and Connectivity

    • Widest range of mobile devices over any network

    • Seamless transition between online and offline

  • Centralized User, Content and End-to-End Security Management

  • Mobile Portal Self-Service Configuration

M business anywhere m ba
M-Business Anywhere (M-BA)

  • M-BA Components

    • Multi-platform client browser

    • HTTP/Synchronization Server

  • Features

    • Integrates into existing web

    • Synchronizes and caches web pages on client

      • Auto-Sensing and On-Demand

    • Custom client and server logic

    • Integration with UltraLite and MobiLink

  • Benefits

    • Ease of developing web applications

    • Always Available

    • Multi-platform

Ultralite for m business anywhere
UltraLite for M-Business Anywhere

  • UltraLite local data store

    • Relational database

    • SQL open standard

    • Fast, Efficient, Robust, Secure

    • Encryption and authentication

  • MobiLink

    • Synchronize directly to your enterprise systems

    • Encrypted stream and authentication to enterprise

    • Script based logic through standard SQL

  • UltraLite for M-Business Anywhere API

    • HTML embeds JavaScript

    • JavaScript to call API

    • Execute standard SQL

  • Optimized access (9.0.2)

    • Performance AND all other benefits of an RDBMS

Ultralite development
UltraLite Development

  • UltraLite Database

    • Created and opened programmatically through a schema file

    • Interface through API classes

    • Web page embedded JavaScript to select, insert, update, delete, synchronize

  • UltraLite Schema

    • UL Schema Painter to create or modify

    • Schema file (.usm) copied down to device through channel

  • Synchronization

    • Initiated through user action or through channel sync (9.0.2)

    • Connection made to MobiLink

    • MobiLink scripts control data movement using standardized script names and events

    • If a script exists, data can be moved back and forth.

    • Separate scripts for upload and download

Ultralite for m business anywhere architecture
UltraLite for M-Business Anywhere Architecture








Web Apps







Tasty baked goods solution sample
Tasty Baked Goods – Solution Sample

  • M-Business Anywhere and UltraLite POD Solution Sample

Tasty baked goods route management

Tasty Baked Goods - Route Management

Tasty Baked Goods - Route Management

  • Route Management

  • Manage Bakery Delivery Route

  • Route is downloaded to device

  • Products that are ordered, delivered and returned updated in database

  • Store manager signs the invoice

  • Historical reports and graphical displays of data

  • Two way sync

Tasty baked goods solution sample1
Tasty Baked Goods – Solution Sample

  • M-Business Anywhere and UltraLite POD Solution Sample

  • DEMO

Getting technical
Getting Technical

  • Client side processing accesses the UltraLite database

  • Manipulating the Client side browser

  • Synchronization

  • Deployment

Getting technical1
Getting Technical

  • Client side processing accesses the UltraLite database

    • Access to the UltraLite POD

    • Connection to UltraLite database

    • Issue SQL commands to UltraLite database

    • UltraLite for M-Business Anywhere API

  • Manipulating the Client side browser

  • Synchronization

  • Deployment

Access to the ultralite pod
Access to the UltraLite POD

  • M-Business Anywhere Group Channels

    • HTML with embedded JavaScript

    • JavaScript files access from HTML

    • UltraLite schema file (USM)

  • JavaScript will attempt to:

    • Reconnect to the UltraLite database specified

    • if that fails, create new connection to the UltraLite database

    • if the database doesn’t exist, create it from the schema

  • Once the POD object has been created

    • Continues to exist

    • Persist connections between different pages

Access to ultralite pod
Access to UltraLite POD

  • UltraLite POD is looking for the string prefix


    dbMgr = CreateObject( "iAnywhere.UltraLite.DatabaseManager.route_mgmt" );

    var dir =;

    var parm = dbMgr.createConnectionParms();

    parm.connectionName = "route_mgmt";

    parm.databaseOnCE = dir + "\\rm.udb";

    parm.schemaOnCE = dir + "\\rm.usm";

Ulpod in m business anywhere client


ULPod = “iAnywhere.UltraLite.DatabaseManager” + “.unique_identifier”

Page 1

Page 2

Page 1

dbMgr = CreateObject

con =


// may or may not

// close con on any page

dbMgr = CreateObject

con =


// choose to close


dbMgr = CreateObject

con =


ULPod in M-Business Anywhere Client

MBA Client


Connection to ultralite database
Connection to UltraLite database

try {

conn = dbMgr.reOpenConnection( "route_mgmt" );

if ( conn == null ) {

conn = dbMgr.openConnectionWithParms( parm );


} catch ( ex ) {

if ( dbMgr.sqlCode == dbMgr.SQLError.SQLE_ULTRALITE_DATABASE_NOT_FOUND ) {

try {

conn = dbMgr.createDatabaseWithParms( parm );

Issue sql commands to ultralite database
Issue SQL commands to UltraLite database

this.getProducts = function( my_cust_id ) {

var query = “ SELECT " +

" FROM customer C, sales_history SH JOIN product P ON PRODUCT_ID " +



var stmt = this.dbConn.conn.prepareStatement( query,

"stmt_get_products" );

stmt.setIntParameter(1, my_cust_id);

var rs, prod_array = new Array;

try { rs = stmt.executeQuery( null );


while ( rs.moveNext() ) {

prod_array[prod_array.length] = rs.getString(1);


} catch ( ex ) { // handle exception }

finally { stmt.close(); }

return prod_array;


Api object heirarchy synchonization
API Object HeirarchySynchonization

Getting technical2
Getting Technical

  • Client side processing accesses the UltraLite database

  • Manipulating the Client side browser

    • API to access to objects on the browser

    • From the browser to UltraLite and back

  • Synchronization

  • Deployment

Manipulating the client side browser
Manipulating the Client side browser

  • JavaScript in HTML must access the browser objects

  • DOM API used for finding and accessing objects

  • JavaScript events for interacting with User

    • onclick, onsubmit, onload, etc

  • Methology shift from server-side

  • Server-Side DHTML

  • Create full HTML file on server

  • HTML tags and data are both string

  • Once sent to client, changes must be resubmitted by client to server and back

  • Client-Side DHTML

  • HTML object already exists

  • add HTML objects dynamically through DOM API

  • Web pages do not need refreshing (re-downloading)

Manipulating dom
Manipulating DOM

Consider the following HTML BODY



<p align="center"><b>List All Products</b></p>

<table border="1" cellpadding="1" cellspacing="1"

width="100%" id="TableList">


<p><a href="main_page.htm">Back to main page</a></p>

<p><a href="insert_page.htm">Insert new Product</a></p>


Manipulating dom1
Manipulating DOM

<table border="1" cellpadding="1" cellspacing="1"

width="100%" id="TableList">


var idx, objTable, eleTR, eleTD1, eleTD2;

objTable = document.getElementById(“TableList”);

for ( idx=0; idx<array.length; I++ ) {

eleTR = objTable.insertRow(idx); = “black”;

eleTD1 = eleTR.insertCell(0);

eleTD1.appendChild( document.createTextNode(idx) );

eleTD2 = eleTR.insertCell(1);

eleTD2.appendChild( document.createTextNode(array[idx]) );


Manipulating dom2
Manipulating DOM

List All Products

Back to main page

Insert new Products

Select example of client side dhtml
SELECT Example of Client-Side DHTML

<html><head><script src="common.js"></script>

<script language="JavaScript1.2">

function Display() {

try {

var pstmt = conn.prepareStatement( "SELECT FIRST cust_name FROM ULCustomer ORDER BY cust_id", "cust_list_ps" );

var rs = pstmt.executeQuery("cust_list_ps");


var objTitle = document.getElementById("Heading_Customer");


} catch ( ex ) { // handle exception }



</head><body onload="Display()" >

<H1 ID="Heading_Customer"></H1>


* Database and “conn” are handled in common.js

Insert example of client side dhtml
INSERT Example of Client-Side DHTML

<script language="JavaScript1.2">

function insertRow()

{ …

var pstmt = conn.prepareStatement( “INSERT INTO ULCustomer (cust_name) values (?)", "cust_insert_ps" );

pstmt. setStringParameter(1, document.insert.custname.value);


… }


</head><body><form name="insert">

<input type="text" name="custname" size="10"><br>

<input type="button" value="Insert"onclick="insertRow();"><br>

<input type="reset" value="Reset">


Getting technical3
Getting Technical

  • Client side processing accesses the UltraLite database

  • Manipulating the Client side browser

  • Synchronization

    • Classes from the API

    • Setting up the parameters

    • Coding

    • Architecture

  • Deployment

Ultralite pod synchronization with mobilink
UltraLite POD Synchronization with MobiLink









Web Apps







Api object heirarchy synchonization1
API Object HeirarchySynchonization

Data synchronization configuration
Data Synchronization Configuration

  • Synchronization

    • MobiLink for data

      • MobiLink sync configuration can be embedded in app

    • M-Business Anywhere for application UI and logic

      • Integrated in ActiveSync Hotsync, use M-Business Connect for wireless

  • Synchronization configuration for MobiLink within M-Business Client

Ultralite synchronization
UltraLite Synchronization

conn.syncParms.setStream( conn.syncParms.STREAM_TYPE_TCPIP );

conn.syncParms.setUserName( document.dbsync.syncusrname.value );

conn.syncParms.setVersion( document.dbsync.syncver.value );

// stream parms include host and port

conn.syncParms.setStreamParms( document.dbsync.syncparm.value );

conn.syncParms.setDownloadOnly( true );


window.showBusy = true;


window.showBusy = false;

if ( conn.syncResult.getUploadOK() != true ) {

alert( "Upload is not OK!" );

} else {

alert( "Synchronization finished!" );


Getting technical4
Getting Technical

  • Client side processing accesses the UltraLite database

  • Manipulating the Client side browser

  • Synchronization

  • Deployment

    • M-Business Anywhere

    • Deploying Channels

    • Schema file

    • Deployment Options

Deploying ultralite for m business anywhere
Deploying UltraLite for M-Business Anywhere

  • Develop a Group for all your download content

  • Each downloadable object is a Channel

    • USM

    • DLL

    • Root HTML file (will bring its children down too)






M-Business Anywhere Admin


Application deployment
Application Deployment

  • Deployment - distributed as M-Business channels

    • Ultralite Pod runtime (500 – 600 KB)

    • Web applications

    • Schema file

Architecture of the client
Architecture of the Client

Win32 M-BA Client

Each Channel Group gets its own

directory for web pages

All binaries including UL Pod DLLs,

USMs, ULConnect.exe

  • Create one Channel Group exclusively for downloading the UL binaries

  • Only download either ULPOD9.DLL or ULPODCLIENT9.DLL

  • Each Channel Group that uses UltraLite, should download its own USM

Where does the database come from
Where Does the Database Come From?

  • Create a USM file using Schema Painter

  • Generate a USM from from an ASA database using ulinit

ulinit -f ../html/common/rm.usm -n Delivery -c "dsn=remote"

Simplified development steps
Simplified Development Steps

  • Create schema for database using Schema Painter

  • Develop web pages that access database

  • Create Group on M-Business Anywhere Server

  • Create channels for all download content

  • Add users to the Group

  • Use the Client to download the content and test

  • Generate MobiLink synchronization scripts*

  • Modify Web pages to invoke synchronization

  • Client does a “Sync All” for channels and test

* this process can be greatly helped by using an ASA remote to auto-generate scripts

Ultralite pod for m business anywhere 9 0 2
UltraLite POD for M-Business Anywhere (9.0.2)

  • Two Options for POD implementation

    • Standalone

    • Client / Engine (9.0.2)

    • Only one should be deployed

Ultralite pod standalone runtime
UltraLite POD – Standalone Runtime

  • Accesses databases directly and quickly but can not be shared.

  • Through ULPod9.dll

  • Deployment to:

    • Win32, Windows CE, Palm OS devices

Ultralite pod ultralite engine
UltraLite POD - UltraLite Engine

  • UltraLite client communicates with UltraLite engine to access databases.

  • Databases can be shared by different applications.

  • Deployment:

    • Win32, Windows CE

  • Requirements

    • ulpodclient9.dll through an M-BA Channel

    • dbuleng9.exe deployed separately

    • ulpodclient9.dll replaces ulpod9.dll functionality

    • Currently only one of ulpod9.dll or ulpodclient9.dll should be deployed to a M-BA Client

    • POD technology will pass “iAnywhere.UltraLite.DatabaseManager” for acceptance

  • Only needed if UltraLite will be access outside of M-BA

One button synch 9 0 2
One-Button-Synch (9.0.2)

  • M-Business Anywhere Channel Sync will initiate a MobiLink/UltraLite Synchronization

  • Deploy

    • ulconnect.exe

    • ulconnect.usm

  • Each successful synchronization (previous example) adds a connection entry into ULConnect.UDB

  • Each connection entry will be synchronized

  • Connection entries can be skipped

    • Connection.skipMBASync = true;

  • Only exists for Win32 and PocketPC

  • PocketPC has a CAB that will install itself

One button synch architecture


MobiLink A


MobiLink B


MobiLink C


One-Button-Synch Architecture


“MobiLink A”

“MobiLink B”

“MobiLink C”

Ultralite for m business anywhere1
UltraLite for M-Business Anywhere

  • Enables mobile workers anytime, anywhere

  • “Always Available” information

  • Easy to develop

    • HTML, JavaScript, SQL

  • Easy to deploy

    • M-Business Anywhere clients download updated/new applications dynamically

  • Secure from device to enterprise

More information
More Information

  • The newsgroups include the following:

  • ianywhere.public.sqlanywhere.general

  • ianywhere.public.sqlanywhere.linux

  • ianywhere.public.sqlanywhere.mobilink

  • ianywhere.public.sqlanywhere.product_futures_discussion

  • ianywhere.public.sqlanywhere.replication

  • ianywhere.public.sqlanywhere.ultralite

  • ianywhere.public.mbusinessanywhere.general