Professional Documents
Culture Documents
Lecture 3
Middleware Fundamentals
Ing-Ray Chen
Copyright Reserved
Lecture Objectives
• Understand role of middleware
• Understand unique requirements of wireless and
mobile applications that middleware should address
• Understand mobile computational models and
functionality supported by various middleware
platforms
1
Sources
• S. Helal, “Pervasive Java,” IEEE Pervasive
Computing, Vol. 1, No. 1, 2002, pp. 82-85 and Vol. 1,
No. 2, 2002, pp. 85-89.
• C. Neable, “The .NET Compact Framework,” IEEE
Pervasive Computing, Vol. 1, No. 3, 2002, pp. 84-87.
• A. Tripath, “Challenges in designing next-generation
middleware systems,” Communications on the ACM,
Vol. 45, No. 6, June 2002, pp. 39-42.
• http://www.wapforum.org/ - for WAP
• http://www.wapforum.com/ - for WAP
• F.P. Coyle, Wireless Web, Addison-Wesley, 2001.
Agenda
• Characteristics of mobile wireless applications
• Role of middleware
• Desirable functionality of mobile middleware
• Overview of mobile middleware for application
developments
• Building your first iPAQ applications with GUI using
the following middleware:
! Sun’s Java Wireless Toolkit and Java 2 Micro Edition (J2ME)
! Microsoft’s Embedded Visual Tool (eVT) with application
wizards
2
Middleware for Mobile Application
Developments
• Client-server computational model:
! Wireless application protocol (WAP)
! Wireless web access
" Server: Microsoft’s Mobile Internet Toolkit (MIT)
" Client: Microsoft’s eMbedded Visual Tool, Sun’s Java 2
Micro Edition, Microsoft’s .NET Compact Framework
• Peer-to-peer and ad hoc computational model:
! Intel/Microsoft Universal Plug and Play (UPnP)
! Jini/J2ME
! Service Location Protocol (SLP)
• Pervasive (or ubiquitous) computing
! Context-sensitive middleware: Transparency vs. awareness
• Data services in wireless mobile environments
3
Role of Middleware
• Middleware is defined as services
provided by a layer in between
the operating system and the Applications
applications
• Middleware provides an abstract User Profile and
interface that gives an application QoS Policy
developer a uniform view of low-
level operating systems and Middleware
networks Services and Protocols
• In wireless mobile environments,
middleware must be flexible to
enable adaptation to changes in Network and Operating
the underlying operating systems System Resources
and networks, and to changes in
application requirements
ECE/CS 4984, Spring 2003 7 Middleware: Fundamentals
4
WAP and Wireless Web Access
• Data transformation
! The WAP gateway performs
data transformation between
WML (or XHTML) and HTML
• Data compression Encoded Encoded
! Technique are used for dealing request Response
with images/graphics (WML)
• Adaptability
! User profile and device WAP Gateway
characteristics are stored in the
WAP gateway
• Security Request Response
! SEP (Secure Enterprise Proxy (e.g., HTTP) (e.g., HTML)
using 128-bit encryption) in
WAP 1.2
• Service discovery and mobility
support Web
! WAP’s “walled garden” – WAP
Server
gateways are provided by ISP
such as AOL
5
J2ME Architecture
Personal
• Configuration layer:
profile defining a minimum set
of JVM features and core
Mobile Information Java class libraries
Foundation profile
Device (MID) profile available on a particular
category of devices
Connected Device
Configuration
Connected, Limited
Device Configuration
• JVM layer (bottom layer)
6
HelloJ2ME – Hello World MIDlet
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
7
Build your First J2ME MIDlet Application
using Sun’s J2ME Wireless Toolkit
• Create a new project
“HelloJ2ME”
• Create a Java source file
using Notepad and put
the file under
C:\WTK104\apps\HelloJ2
ME\src
• Build HelloJ2ME
• Run HelloJ2ME on a
selected emulator
• Input: Can use the
keyboard on the PC
ECE/CS 4984, Spring 2003 15 Middleware: Fundamentals
8
Microsoft’s .NET Compact Framework
9
Mobile Data Access in .NET CF
10
User Interface Design on Pocket PC
• User Interface design constraints
! A small, portrait-oriented, touch-sensitive screen
! User input with an input panel and the stylus (pointer)
" Single-tap: opening an item
" A tap and hold: displaying a pop-up menu or a tip
• Normally no “Close” button is necessary:
! Pocket PC automatically closes idle applications as more
memory is needed
• Normally no “Save” button is necessary:
! The pocket PC relies on application’s “autosave” to retain
user data, so no data loss would occur when switching
applications or powering down
11
Pocket PC User Interface Controls
• Buttons • Combo boxes
• Check boxes • Up/Down controls
• Option buttons • Date/Time pickers
• Command bars • MonthCal controls
• Tool bars • List views
• ToolTips • Header controls
• Menus • Tree views
• Pop-up menus • Group Line Separators
• Message boxes • Scroll bars
• Property sheets • Sliders
• Tabs • Status bars
• Text boxes • Progress bars
• List boxes
ECE/CS 4984, Spring 2003 23 Middleware: Fundamentals
12
Build Your First Pocket PC Application
with GUI using Microsoft’s eVC++ (1)
• Building a Pocket PC application with GUI:
! Use the eVC++ IDE Application Wizard to create the shell
of your application instead of from scratch
! Use the Resource Editor to create menus and resources,
such as dialog boxes
! Use “drag and drop” to put UI controls in your
application and fill in the event code for control actions
• Running your GUI application
! Select project configuration
" Run/debug in the emulation environment
" Release/deploy the project to Pocket PC
! Set the active WCE configuration
" Choose platform/device: WIN32 WCE/Pocket PC
ECE/CS 4984, Spring 2003 25 Middleware: Fundamentals
13
Build Your First Pocket PC Application
with GUI using Microsoft’s eVC++ (3)
• Types of
Applications:
! Single
Document with
Doc List
! Single
Document
Interface (SDI)
! Dialog based
• All are forms-
based
! Dialog-based
is the simplest
14
Build Your First Pocket PC Application
with GUI using Microsoft’s eVC++ (5)
• When a single document with
Doc List application is created,
a Doc List control is also added
to the UI
• All Folders also lets you see
files that are saved in the root
of the My Documents folder.
The folders shown in the menu
are subfolders of My
Documents
• “New”, and “Tools” menus are
created automatically in the
menu bar by the AppWizard
! The developer then insert code
into event handler routines
ECE/CS 4984, Spring 2003 29 Middleware: Fundamentals
15
Build Your First Pocket PC Application
with GUI using Microsoft’s eVC++ (7)
• Add event-
handling code
to UI controls
in response to
input, e.g., to button
a text control,
or to a button
control, etc.
• Double click
on a control to
bring up the
code insertion
interface
// get the stock symbol entered by user from the edit box
symbol->GetWindowText(strSymbol) ;
// generate a stock price in the range of 20*(1+[-10%,10%])
sprintf( buf, "%6f", 20 *(1 + (rand() % 20 -10)/100.0));
// insert the result into the list box for display
resList->InsertString(0, strSymbol + “\t” + CString(buf) );
}
ECE/CS 4984, Spring 2003 32 Middleware: Fundamentals
16
Debugging and Deployment in eVC++
• deployment
! Deploy and run the application on the iPAQ
17
J2ME Code for the Standalone Stock
Quote Application
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;
import javax.microedition.io.*;
public lab3_j2me () {
mainForm.append (symbolField);
mainForm.append (resultItem);
mainForm.addCommand (getCommand);
mainForm.setCommandListener (this);
}
18