Mobile client-server communications CSE 390 Fall 2010 Cellular connection types • Time Division Multiple Access (TDMA) – assigns calls a time slot on a given frequency. Used by GSM. • Code Division Multiple Access (CDMA) – assigns each call a unique code. Used by UMTS. • Global System for Mobile Communication (GSM) – most popular standard. 80% of the global market, 1.5 billion users, 212 countries. Extensive roaming arrangements with international mobile operators. Second Generation (2G) technology – meaning both signaling and speech channels are digital. GSM introduced Short Message Service (SMS). Different frequencies are used in many countries (USA and Canada use 850MHz and 1900MHz). The iPhone has a tri-band frequency chipset to accommodate the most common frequencies. Cellular connection types (cont.) • Enhanced Data Rates for GSM Evolution (EDGE) – a “bolt-on” enhancement for GSM networks to provide higher bit rates. Does not require installation of new transmitter towers. • Universal Mobile Telecommunications System (UMTS) – Third Generation (3G) technology based on many of the GSM protocols (and was originally called 3GSM), but uses CDMA as the underlying air interface. Uses same core network standard as GSM – Mobile Application Port (MAP). Uses Universal Subscriber Identity Module (USIM) – compatible with GSM’s SIM – for user authentication. Requires installation of new transmission towers – expensive to migrate. Wireless connection types • IEEE 802.11a/b/g – Wireless Local Area Network (WLAN) technology. More generally called WiFi. Network access points are called hotspots. Typically operates in the range of 2.4 GHz, with a range of about 120 feet indoors and 300 feet outdoors. Signal can be affected by radio reflection off buildings and trees. Interference can also be caused by devices operating on the same frequency (such as microwave ovens). Uses Wired Equivalent Privacy (WEP) for security. • Bluetooth 2.1 – Wireless Personal Area Network (WPAN) technology. Uses frequency hopping spread spectrum radio technology, also in the 2.4GHz range. Data rate of 1Mbit/s is possible. Range is about 33 feet (10 meters). The most common applications for mobile devices are connecting wireless headsets and printing to bluetooth-enabled printers. A master bluetooth device can connect with up to seven devices in a wireless user group. Thin clients • • • Less device and OS specific than fat clients, but require a persistent network connection. No custom application code is needed on the device, instead an industry-standard web or WAP (Wireless Application Protocol) browser provides the functionality. The browser may run some client-side scripting, such as Javascript. But typically the server handles all the logic and data functions. Still, devices vary in many ways, such as screen size, so a renderer running on the server is often used to customize the content for the device. The application data is stored in XML files and separate XSL style sheets are created for each supported device. At run time the server checks the device’s browser type, transforms the XML, and renders the the content to the device. The downside of this approach is the need to develop multiple XSL files for each web page you wish to display. The upside of this approach is that application code can be modified and updated in one place – the server – and not on potentially thousands (or millions) of devices. Fat clients • Advantages of this approach are when devices are only connected to a network infrequently, or when you want utilize a specific peripheral of the device, such as the camera, phone, or GPS. • Use cases, such as can be modeled using the Unified Modeling Language (UML), include the following: – Log in (for many reasons, such as the device may be lost or stolen, or that you will allow the user to access and edit data on a server) – Task selection, by presenting a menu of options for the user – Data download, such as doctor searching for patient records, or a salesperson looking for account information – Edit data locally, to modify the patient or account records – Upload changes Fat clients (continued) • • • Object reuse – for many business applications code may have already been written that would have to be rewritten for each device you want to support. One way around this is to expose these business objects on the server by creating an XML web service, which would forward method calls to those objects. Object design – object oriented code design allows code to be more easily ported. Common object properties and methods include: – Constructor (often called New) creates a new object by allocating memory for it and initializing it – Destructor releases the object and frees up the memory allocated to it – Save allows data and preferences to persist between uses of the application – Delete – Get back-end data Data Access Object – common methods include: – Create database – Check that database exists – Delete database – Execute SQL command – Execute dataset (executes a SQL command and returns a dataset) Client-server data transfer • HTTP and HTML – A web browser on the client uses an HTTP GET request for information of the server, typically through port 80. The server retrieves the information and sends it, after which the sever connection closes. A client may also send information to the server using the HTTP POST method. • WAP and WML – When a client with a WAP browser accesses a web page the request is initially sent to a WAP gateway, which then forwards the request to the HTTP server. The WAP gateway then encodes the response and returns it to the client as WML (Wireless Markup Language). The structure of WML is a deck of cards. A deck has a URL like a web page and contains one or more cards. Each card represents a small screen of information, like a menu or a data entry screen. Generally each card only displays a few lines of data. In Japan, i-Mode is a competing technology. Client-server data transfer (cont.) • Remote Database Access (RDA) – is a protocol standard for database access. RDA describes the connection of a database client to a database server. It includes features for: – communicating database operations and parameters from the client to the server, – transporting result data from the server to the client, – database transaction management. • RDA is an application-level protocol, meaning that it builds on an existing network connection. It allows the developer to push and pull data from the mobile database and the server side database. It also allows the application to send SQL statements to be executed on the remote server. If there is an error pushing data to the server, the records that were not uploaded are placed into an error table. Client-server data transfer (cont.) • Simple Object Access Protocol (SOAP) - is a protocol for sending structured data between remote computers over a network. The SOAP spec was defined by the W3C, and was designed as a mechanism for performing remote procedure calls using XML over HTTP. Because SOAP is an open standards-based protocol, it can be used on any OS, and provides interoperability among devices running different operating systems. • SOAP’s messaging framework defines rules for constructing and processing SOAP messages. A SOAP message is an XML document consisting of a SOAP envelope. The envelope has a Body element, which contains the message payload and or error information. The envelope may also have a Header element which can pass information not part of the main method call, such as message priority or authentication information. • SOAP messages can be quite large. Client-server data transfer (cont.) • Web Services Description Language (WSDL) – provides a spec for describing a web service in XML. The description contains information about the messages, data types, and protocols the web service supports. It contains the following items: – – – – – Service Name Port (the URL of the web service) Binding (transport and encoding protocols of the port) Port Type (operations supported by the web service) Messages