Introduction to Mobile Computing Aleksandar Kovačević, renesto@gmail.com Mina Mićanović, minica82@EUnet.yu Veljko Milutinović, vm@etf.bg.ac.yu Aleksandar Kovačević & Mina Mićanović 1 Wireless Mobile or Mobile Wireless? • Wireless communication systems are type of communication system • Dimensions of mobility: The set of properties that distinguishes the mobile computing system from stationary computing system Aleksandar Kovačević & Mina Mićanović 2 / 95 Dimensions of Mobile Computing • • • • • • • Location awareness Network connectivity quality of service (QOS) Limited device capabilities Limited power supply Support for a wide variety of user interfaces Platform proliferation Active transactions Aleksandar Kovačević & Mina Mićanović 3 / 95 Mobile Development Framewor and Tools Aleksandar Kovačević & Mina Mićanović 4 Mobile Development Frameworks and Tools • Fully Centralized Frameworks and Tools • N-Tier Client-Server Frameworks and Tools Aleksandar Kovačević & Mina Mićanović 5 / 95 Fully Centralized Frameworks and Tools • Have custom-designed clients • Embedded in nature • Designed to do only one thing Aleksandar Kovačević & Mina Mićanović 6 / 95 Fully Centralized Frameworks and Tools Applies: • QOS • Limiter power supply • Active transactions • Location awareness Do not apply: • Platform proliferation • Limited device capabilities • Support for variety of user interfaces Aleksandar Kovačević & Mina Mićanović 7 / 95 Examples • Call centers • Battlefield systems • Grocery store Aleksandar Kovačević & Mina Mićanović 8 / 95 N-Tier Client-Server Framework and Tools • N-Tier -Any Number of Tiers – No Limits • 3-Tier – Client (User Agent) – Application Server – Database Aleksandar Kovačević & Mina Mićanović 9 / 95 Basic problems • Code portability • Mobility Aleksandar Kovačević & Mina Mićanović 10 / 95 Needs • Layer of Software • Performance and system requirements Aleksandar Kovačević & Mina Mićanović 11 / 95 Selection of the Frameworks and Tools • Thin-Client Wireless Client-Server • Thick-Client Wireless Client-Server • Stand-alone Applications Aleksandar Kovačević & Mina Mićanović 12 / 95 Thin-Client Wireless Client-Server • Browser that loads markup code (Web-model) • No concern about environment • Server-side structure • Example: WAP with his WML Aleksandar Kovačević & Mina Mićanović 13 / 95 Thick-Client Wireless Client-Server • Client application-custom application • Using the client as a means of storing data for the offline business logic performs • Does not need to be centralized • Having thick clients is more difficult Aleksandar Kovačević & Mina Mićanović 14 / 95 Difficulties??? • Restricted resources • Deployment and provision problem – Operating system or virtual machine – Programming environment Aleksandar Kovačević & Mina Mićanović 15 / 95 Examples • Operating system – Windows CE – Symbian • Virtual Machine – J2ME Aleksandar Kovačević & Mina Mićanović 16 / 95 Stand-alone Applications • They do not need networking components • Needs of synchronization with some external system periodically Aleksandar Kovačević & Mina Mićanović 17 / 95 Some products Connectivity Networked Stand-alone Wired Platform Wireless WAP Symbian Mobile Platforms BREW Java .NET Aleksandar Kovačević & Mina Mićanović 18 / 95 JAVA - features • • • • Object oriented language Complete code mobility Weak mobile agent ability It is a platform Aleksandar Kovačević & Mina Mićanović 19 / 95 J2ME Addresses the needs of two categories of devices: – Personal, mobile, connected information devices (CLDC) – Shared, fixed, connected information devices (CDC) Aleksandar Kovačević & Mina Mićanović 20 / 95 CLDC/MIDP Features(1) Providing: • a virtual machine for providing language features • a security framework for tasks such as downloading MIDlets (J2ME CLDC/MIDP applications) *MIDP - Mobile Information Device Profile Aleksandar Kovačević & Mina Mićanović 21 / 95 CLDC/MIDP Features(2) Providing: • a reasonable amount of functionality for input and output • some internationalization capabilities • a reasonable amount of networking capabilities Aleksandar Kovačević & Mina Mićanović 22 / 95 KVM Does not provide: – – – – – Floating point arithmetic Support for JNI Thread grouping Full-blown exception Automatic garbage collection of unused objects – Weak references Aleksandar Kovačević & Mina Mićanović 23 / 95 CLDC/MIDP features • Providing a security framework for tasks such as downloading MIDlets (J2ME CLDC/MIDP applications) Aleksandar Kovačević & Mina Mićanović 24 / 95 CLDC/MIDP features • Providing a reasonable amount of functionality for input and output Aleksandar Kovačević & Mina Mićanović 25 / 95 Internationalization capabilities • Provides I/O stream readers that can handle different character encoding schemes Two ways of internationalization: • Dynamic • Static Aleksandar Kovačević & Mina Mićanović 26 / 95 Profiles • The areas addressed by profiles are the following: – – – – – Download and installation of application Life-cycle management of application User interface feature Database functionality Event handling Aleksandar Kovačević & Mina Mićanović 27 / 95 CLDC profiles • MIDP (Mobile Information Device Profile) – Widely known and accepted • Personal Digital Assistant Profile (PDAP) • etc. Aleksandar Kovačević & Mina Mićanović 28 / 95 MIDP Designed for devices with assumed characteristics • Small displays (96x24,1:1 shaped pixels, depth 1bit) • Min 128kB of nonvolatile memory (for storing application itself) • Wireless connection to the internet • Min of 8kB of nonvolatile memory (for use by the application) • ITU-T phone keypad Aleksandar Kovačević & Mina Mićanović 29 / 95 Overview of the CLDC and MIDP Java APIs • J2SE-like APIs – inherited from the J2SE environment – java.lang.* – java.io.* – java.util.* • CLDC-specific APIs – javax.microedition.io (connector class) Aleksandar Kovačević & Mina Mićanović 30 / 95 Networking Capabilities • J2SE assumes the availability of a TCP/IP connection • CLDC defines a connection framework in its Java API example – WAP-style connections (WDP/UDP) Aleksandar Kovačević & Mina Mićanović 31 / 95 Review of MIDP APIs • Timers – java.util.Timer – java.util.TimerTask • Networking – HTTP implementation – javax.microedition.io.* holds HttpConnection Aleksandar Kovačević & Mina Mićanović 32 / 95 Review of MIDP APIs • Storage – javax.microedition.rms.* (RMS-Record Management System) – for storing and retrieving data • User Interface – javax.microedition.lcdui.* user interface APIs to build interfaces for MIDlets Aleksandar Kovačević & Mina Mićanović 33 / 95 Hello MIDP example For a J2ME class to qualify as a MIDlet, it has to do the following: 1. Extend the MIDlet class 2. Implement the following methods: a) startApp() b) pauseApp() c) destroyApp(boolean b) Aleksandar Kovačević & Mina Mićanović 34 / 95 Hello MIDP example import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloMIDP extends MIDlet implements CommandListener { public static final String HELLO = “Hello MIDP”; private DIsplay mDIsplay; private Command mExit; public HelloMIDP() { mDisplay = Display.getDIsplay(this); mExit = new Command(“Exit”, Command.SCREEN, 1); } Aleksandar Kovačević & Mina Mićanović 35 / 95 Hello MIDP example public void startApp() { TextBox myMessage = new TextBox(HELLO, HELLO, 256, 0); myMessage.addCommand(mExit); myMessage.addCommand((CommandListener) this); mDisplay.setCurrent(mDIsplay); } public void pauseApp() {} public void commandAction(Command aCommand, Displayable aDisplayHandle) { if (aCommand == mExit) { destroyApp(false); } } public void destroyApp(boolean b) { notifyDestroyed(); } } } Aleksandar Kovačević & Mina Mićanović 36 / 95 Sun’s Development Kit Offers following components: • • • • • KToolbar (GUI) Preverifier Compiler Emulators Emulation of Performance Aleksandar Kovačević & Mina Mićanović 37 / 95 Dimensions of Mobility by CLDC and Profiles • Location awareness – no treatment – javax.microedition.location • • • • • • Network QOS Limited Device Capabilities Limited Power Supply Management Support for a Large Variety of User Interfaces Platform proliferation Active Transactions Aleksandar Kovačević & Mina Mićanović 38 / 95 XML & J2ME Types of parsers: • Model Parsers • Push Parsers • Pull Parsers Aleksandar Kovačević & Mina Mićanović 39 / 95 Using UML to Model J2ME Applications • • • • Class Diagrams State Diagrams Component Diagrams Sequence Diagrams Aleksandar Kovačević & Mina Mićanović 40 / 95 CDC • Targeted at environments where more than 512kB (usually about 2MB) of memory is available for the Java environment • CDC Profiles are built on top of the Foundation Profile • CDC has his own virtual machine (CVM-C Virtual Machine) • CVM supports all of the features that the J2SE VM does Aleksandar Kovačević & Mina Mićanović 41 / 95 Java Card • Smart cards – embedded processor or electronic memory device • Java Card API – allows interoperability between different card readers/writes and cards regardless of the manufacturer and Java Card API implementer Aleksandar Kovačević & Mina Mićanović 42 / 95 Java Card Aleksandar Kovačević & Mina Mićanović 43 / 95 Three Types of Smart Cards • IC (Integrated Circuit) Memory Cards • IC Microprocessor Cards • Optical Memory Cards Aleksandar Kovačević & Mina Mićanović 44 / 95 JINI Java Intelligence Network Infrastructure – a base technology for ad-hoc networking Basic transaction that JINI provides: • • • • • • Lookup Discovery Events Leasing Joining Transaction Management Aleksandar Kovačević & Mina Mićanović 45 / 95 JINI Specification • Most today’s implementations are not designed for mobile devices • There are some that offer “mobilized JINI” – PSINaptic Aleksandar Kovačević & Mina Mićanović 46 / 95 Java-based Peer-to-Peer Protocol JXTA – peer-to-peer protocol Implementation on J2ME – Direct Implementation (JXTA APIs - provided on J2ME device) – Indirect Implementation (JXTA through proxies) Aleksandar Kovačević & Mina Mićanović 47 / 95 BREW BREW (Binary Run-time Environment for Wireless) • It is built directly on hardware • Software Development Kit (SDK) Aleksandar Kovačević & Mina Mićanović 48 / 95 BREW SDK Overview • • http://www.qualcomm.com/brew – register as a developer – download BREW SDK – offered only as a integrate set of components with MS Visual C++ 6.0 You get this applications – BREW MIF Editor – BREW Device Configurator – BREW Emulator – BREW Image Authoring Tool – BREW ARM Compiler – Image Converter – BREW Resource Editor – BREW Pure Voice Converter – BREW AppLoader – BREW Grinder – BREW TestSig Generator and AppSigner Aleksandar Kovačević & Mina Mićanović 49 / 95 Building and Deploying a BREW Application • • • • • • • Download the SDK and get started Obtain a Verisign Class 3 certificate Get a BREW phone Register as a BREW developer Obtain a Class ID for your application Perform a unit test and send it to a testing lab Perform a pricing and carrier evaluation Aleksandar Kovačević & Mina Mićanović 50 / 95 Get a BREW and Start Obtain Class 3 Certificate from Verisign True BREW Test Unit Test Get a Class ID Download SDK No Done Phone Develop Yes Pricing and Carrier Evaluation Aleksandar Kovačević & Mina Mićanović 51 / 95 Hello BREW • AEEClsCreateInstance – BREW Run-time environment • HelloBREW_HandleEvent – EventHandler Aleksandar Kovačević & Mina Mićanović 52 / 95 Architectural Concerns About BREW Application • Everything in BREW is event driven (tight coupling to the hardware platform) • Two groups of APIs you can use: – those provided by qualcomm – those provided by third-party vendors • BREW API is still developing in C Aleksandar Kovačević & Mina Mićanović 53 / 95 Windows CE Different flavors of the Windows CE OS, depending on hardware platform. • Pocket PC • Windows CE .NET • Pocket PC 2002 Aleksandar Kovačević & Mina Mićanović 54 / 95 Tools to build Applications • Embedded Visual C++ – separate from Visual Studio – Emulators and a debugger is provided – exception handling, run-time debugging • Embedded Visual Basic – can be developed faster – no ability to be tuned and optimized for resource-starved mobile devices • Smart Device Extensions for .NET • Microsoft Mobile Internet Toolkit Aleksandar Kovačević & Mina Mićanović 55 / 95 eMbedded Visual C++ Compilers available for: • • • • • ARM MIPS Intel’s x86 PowerPC Hitachi processors Aleksandar Kovačević & Mina Mićanović 56 / 95 eMbedded Visual C++ Provides: • a subset of the Win32 APIs for building Windows CE applications • a subset of the MFC (Microsoft Foundation Classes) libraries • a set of classes specific to the Windows CE platform Aleksandar Kovačević & Mina Mićanović 57 / 95 Things You Should keep in mind • • • • Graphics are expensive Use events instead of polling when possible Economize with your memory (saving power) Provided functionality of getting the status of the Power Consumption – useful for testing application – useful to change behavior of application • Clean up memory resources whenever you get WM_HIBERNATE event Aleksandar Kovačević & Mina Mićanović 58 / 95 Databases on Windows CE Three ways to store data: • MS SQL Server Windows CE Edition – most functionality – takes the most resources – offers only subset of its desktop/server version • views • stored procedure • CEDB – small and simple database – it’s not relational database • File System – fewer resources – increases the application Aleksandar Kovačević & Mina Mićanović 59 / 95 Windows CE and Web Services • Importance of XML-based Web Service • .NET has Web Service-based functionality based on two key technologies: – WSDL (Web Service Definition Language) – SOAP (Simple Object Access Protocol) Aleksandar Kovačević & Mina Mićanović 60 / 95 Microsoft Smart Phone • Microsoft Smart Phone 2002, Microsoft's attempt to enter the mobile technology market • It can host custom applications written using smart phone SDK. SDK is provided as a plug-in for eVC Aleksandar Kovačević & Mina Mićanović 61 / 95 WAP • • WAP – Wireless Application Protocol Installed on almost every mobile phone Basics about WAP: • WAP is intended for thin clients – all logic calculated on the server – simple display instructions in some markup language are done by the client • • • WAP is built on its own lower level communication protocol Typical deployment of WAP includes a proxy or a gateway WAP is a complete framework for a mobile applications Aleksandar Kovačević & Mina Mićanović 62 / 95 WAP Architecture • It’s a client-server Architecture • Implementation standards – for client to interpret content – communication mechanisms between the clients and the servers – additional required features in the server (particulary proxy servers) • Communication functionality between clients and server: – Handling of Telephony on the Device – Push Aleksandar Kovačević & Mina Mićanović 63 / 95 Basic Communication Architecture in WAP WAP Client WAP Proxy / Application Gateway Server HTTP/ HTTPS WSP,WTP,WTLS,WDP Aleksandar Kovačević & Mina Mićanović 64 / 95 WAP UI Developing WML pages WML – Mark-up language rendered by the WAP micro browsers Advantages over HTML • WML tag is smaller • WML is XML compliant • WML is designed for small monochrome screens – allows breaking a page into a deck of cards – allows client-side navigation between the cards • WML has mark-up tags that allow interacting with the telephony Disadvantages • Most content on Internet is in HTML • Conversion of HTML to WML is not easy process – WAP 2.0 fixes that using XHTML that is well-formed and using XML techniques like XSLs to convert XHTML to WML Aleksandar Kovačević & Mina Mićanović 65 / 95 WAP Proxies and Gateways • A server that supports WAP and HTTP • Difference between the proxy and the gateway: user can determine will he use proxy Aleksandar Kovačević & Mina Mićanović 66 / 95 WAP Gateways (1) Features of WAP Gateways: • Security – Handoff point between WTLS (Wireless Transport Layer Security) to external security mechanisms (SSL) • Network Access – Access point – Controlled access by Network Provider • Protocol Conversions – Converting WSP (Wireless Session Protocol) to HTTP Aleksandar Kovačević & Mina Mićanović 67 / 95 WAP Gateways (2) • Caching – Extremely aggressive caching – cache expire must be set manually – reduces the pervasiveness of content • Preparation of Content and Scripts – Gateway encodes WML into Compiled WML (WMLC) – WMLScript must be compiled before being sent to client • Functionality offered through WAP 2.x – offering model of connectivity that puts increasingly less functionality into the proxy Aleksandar Kovačević & Mina Mićanović 68 / 95 MMS MMS - Multimedia Messaging Services • WAP MMS is a standard • Overview: – Presentation • handled through SMIL (Synchronized Multimedia Integration Language) – Addressing • two addresses: – address of the MMS Proxy-relay – address of the recipient user and terminal – Delivery is possible through variety of interfaces. These include the following: a. MMS proxy-relay b. Standard email interface (supports any email protocol) c. Legacy wireless messaging systems Aleksandar Kovačević & Mina Mićanović 69 / 95 WAP Push • Based on Push Access Protocol (PAP) • Push operation WAP push event do the following: • The mobile device connects and registers to Master Pull Proxy • Application Server establishes a connection to PPG through PAP protocol • The content being pushed can be a multipart document following the MIME format • The user agent profile is accessed. • The message is then sent to PPG • The devices receives the message Aleksandar Kovačević & Mina Mićanović 70 / 95 Security • WAP does not have application authorization • Offers guaranteed authentication of user devices • Offers guaranteed integrity of transactions Aleksandar Kovačević & Mina Mićanović 71 / 95 Symbian EPOC • Symbian OS 7.0 supports: MMS, HTTP, SyncML, SMS, Mobile IP, IrDA, and Bluetooth • It has free SDK (supported languages: C++ and Java) • Designed more as a PDA OS Aleksandar Kovačević & Mina Mićanović 72 / 95 Publishing Frameworks • Presenting content in several different formats • Matching the type of document requested with the type of document available (or one that may need to be generated at run time) • Modularized infrastructure that separates the various components of the framework, the processing components, and the content Aleksandar Kovačević & Mina Mićanović 73 / 95 Publishing Frameworks Examples: • Apache’s Cocoon – best known publishing framework today – written in Java, supports ASP, Java and XSL (and many other) • IBM’s Wireless Transcoding Publisher They treat the user interface problems presented by the following: • Proliferation of mobile devices • Localized and Internationalized user interfaces • Selection of segments of multichannel content • Selection and composition of content based on device information Aleksandar Kovačević & Mina Mićanović 74 / 95 Cocoon • Open-source – widely accepted • Got his name from the movie • Cocoon’s Architecture aim to separate: – – – – content style (the formatting of content) logic (how content is generated or chosen) management of content (creating content) Aleksandar Kovačević & Mina Mićanović 75 / 95 Cocoon’s Architecture Generators Serializers PDF XML VXML Binary WML Java XHTML Aleksandar Kovačević & Mina Mićanović Transformers 76 / 95 Generators • Take static/dynamic content • Generate XML in the form of SAX events There are series of generators: • File generator • Server pages generator • JSP generator • Request generator Aleksandar Kovačević & Mina Mićanović 77 / 95 Transformers • Xalan – XSL transformation engine • XSLs are not platform dependent or language dependent Aleksandar Kovačević & Mina Mićanović 78 / 95 Serializer • Responsible for publishing to the client through HTTP response • FOPSerializer (Converts HTML to PDF) • SVG Serializer Aleksandar Kovačević & Mina Mićanović 79 / 95 IBM Wireless Transcoding Publisher • Focusing on product, IBM Wireless Everyplace Suite • Integrated environment with IBM’s Websphere Application Server • Our focus is on pervasive and mobile aspects of this suite and comparison with Cocoon Aleksandar Kovačević & Mina Mićanović 80 / 95 Overview of IBM Everyplace Suite Addresses issues like: • wireless connectivity • content management for wireless clients • wireless security • provisioning and device management Aleksandar Kovačević & Mina Mićanović 81 / 95 Comparison of the WTP and Cocoon • WTP offers better functionality in converting HTML to any other markup language than Cocoon • WTP offers custom transformers that convert variety of image formats • WTP offers a set of WAP devices that allow very simple publishing of HTML and XML content to WML-enabled devices • Very rich set of tools for developers Aleksandar Kovačević & Mina Mićanović 82 / 95 Other Tools • Asynchronous Messaging Systems • UML Tools Aleksandar Kovačević & Mina Mićanović 83 / 95 XML for Mobile Computing Aleksandar Kovačević & Mina Mićanović 84 XML and Mobile Applications • Mobile applications should understand and be able to manipulate XML content • Mobile applications use XML to facilitate their implementations Aleksandar Kovačević & Mina Mićanović 85 / 95 Key XML Technologies for Mobile Computing • • XHTML VXML – designed for voice user interfaces – allows specification of a command-based voice dialog through a markup language • • • • • • • WML XForms CCXML XML Pipeline WBXML SSML RDF Aleksandar Kovačević & Mina Mićanović 86 / 95 CCXML Call Control Extensible Markup Language – Application of XML for managing voice calls – It focuses on routing the calls and connecting calls (in contrast to VXML) – It is based on Java Telephony APIs (JTAPI) Aleksandar Kovačević & Mina Mićanović 87 / 95 XML Pipeline • It specifies how to process various XML resources It can be thought in two different contexts: • It specifies the flow of processing instructions that are applied to one or more given documents residing on the host • It specifies the flow of processing instructions that are applied to a variety of XML documents, residing at a variety of hosts Aleksandar Kovačević & Mina Mićanović 88 / 95 Sample XML Pipeline Document <?xml version=“1.0”> <pipeline xmlns=“http://www.w3.org/2002/02/xml-pipeline” xml:base=“http://www.cienecs.com/Examples/XMLPipeline”> <param name=“target” select=“’result’” /> <!– This section defines the processes and links them to their definitions (typically some hint to the controller on where and how to start off the processes). We chose Java for our examples, so the definition is in terms of Java classes. --!> <processdef name=“selector” definition=“com.cienecs.mobile.http.get_content_selector” /> <processdef name =“selector_content” definition=“com.cienecs.mobile.http.get_content_generator” /> <processdef name=“authenticator” definition=“com.cienecs.mobile.security.authenticator ($username) ($password)” /> <processdef name=“transformer” definition=“com.cienecs.mobile.transformer.xslt” /> <!– For our example, we chose a set of processes that select some content based on the user’s request. SO, the first thing to do is to find the content that the user requested. --!> <process id=“3” type=“selected_content” > <input name=uti_param_1” label=“content_finder_param_1” /> <input name=“uri_param_2” label=“content_finder_param_2” /> <output name=“cresult” label=“generic_content_URI” /> </process> Aleksandar Kovačević & Mina Mićanović 89 / 95 Sample XML Pipeline Document <!– For our example, we want to transform the content based on the device that the user is using. SO, we need to fire off a process that finds out the user’s device type.. --!> <process id=“1” type=“selector” > <input name=“deviceId” label=“unique_device_id” /> <input name=“ccpp_header_string” label=“ccpp_header_string” /> <output name=“result” label=“device_type” /> </process> <!– Now, based on the user’s device type and the selected content, we can find the right type of transformer and transform the content properly. --!> <process id=“2” type=“transformer” > <input name=“device_type” label=“device_type” /> <input name=“generic_specific_URI” label=“generic_content_URI” /> <input name=“authenticated” label=“authenticated” /> <output name=“device_specific_content” label=“device_specific_content” /> </process> </pipeline> Aleksandar Kovačević & Mina Mićanović 90 / 95 XML Pipeline Recognize type of processes: • Constructive processes produce new information • Augmenting processes add new types (definitions) of information • Inspection processes look at the content of a document • Extraction processes copy a part of the document that they look into • Packaging processes are distributed processes that address the processing of distributed resources Aleksandar Kovačević & Mina Mićanović 91 / 95 WBXML • WAP Binary Extensible Markup Language • Defines a way to represent XML in 0’s and 1’s instead of text • KXML (parse WBXML) Aleksandar Kovačević & Mina Mićanović 92 / 95 SSML • Synthetic Speech Markup Language • It is used for the infrastructure of the voice user interface Aleksandar Kovačević & Mina Mićanović 93 / 95 RDF • Resource Description Framework • Created specifically: – to allow discovery of various resources – indexing them – creation of resources that are made up of other RDF resources by simply nesting the RDF descriptions • RDF is part of Semantic Web. Aleksandar Kovačević & Mina Mićanović 94 / 95 Thank You for Your Attention Aleksandar Kovačević & Mina Mićanović 95