Mobile App Development: WAP & Mobile Options, Lecture notes of Mobile Computing

A complete lecture notes for Mobile Computing

Typology: Lecture notes

2018/2019

Uploaded on 11/01/2019

gebriye-embafresu
gebriye-embafresu 🇪🇹

5

(1)

8 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
IT408 Mobile Computing
Mobile Application Development
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Mobile App Development: WAP & Mobile Options and more Lecture notes Mobile Computing in PDF only on Docsity!

IT408 Mobile Computing

Mobile Application Development

Wireless Application Protocol (WAP)

 Why WAP/WML? Coz the standard internet protocols like TCP/IP, HTTP, HTML do not work well with mobile devices across wireless networks

Characteristics of Mobile Devices

 Small memory and processing power

  • Usually from 2MB upto 64MB unlike PC which have a considerable memory and CPU  Small display color preferences
  • Limited color displays(monochrome) unlike PCs which support millions of colors  Limited screen with low resolution
  • Typically 128160 or 320480 pixels
  • For PCs the screen resolution is 640480, 1600  Limited bandwidth
  • Low bandwidth, 9.6 Kbps to 11Mbps(for 3G)
  • >28.8 Kbps for wired networks  Intermittent connectivity and high latency
  • Due to mobility of devices, networks, etc  Varying configurations, browser languages, etc

Mobile Application Development

  • Development of applications for small, low-power handheld devices.
  • Applications can be pre-installed by vendor during manufacture or downloaded from app stores by the user or custom-developed by developers to suit specific purposes.
  • Identify mobile platforms? o Android (big player) o iOS (Apple) – big player o Windows Phone 7 o Symbian o RIM’s BlackBerry ( on the realm of decline) o PALM (doesn’t exist today) o Badda (Samsung)

Mobile Development Options

  • Build one application for one platform and hope that platform succeeds (cheapest and fastest)
  • Build applications for multiple platforms – covers all your bases but is most expensive and time consuming (put it in their app store, users will then download them)
  • Media capture API – app access to camera microphone
  • Messaging - SMS, MMS, email
  • Gallery – stored media interactions

Development Environments

  • J2EE/J2ME (Eclipse, Netbeans)
  • .NET (VS)

WAP 1.* was based on various mobility "optimized" protocols and formats.

WAP 2.* brought things a step closer to the "real" Internet by switching from WML to XHTML MP (Mobile Profile) and HTTP over TCP (instead of WTP, WSP & whatnot).

Many phones now even support (more or less & usually a bit less than more) full HTML, too. Sometimes with a, so called, dual-mode browser (with both WML and HTML support in one, single app. Sometimes phones have a separate WAP browser and another HTML/web browser.

In any case, there are phones out there (even new ones) with only WAP 1., and phones with WAP 2.

Eventually all things WAP will disappear, but until they do, depending on the situation, you either need to (or at least should) support it. Up to you, your user base & other reasons.

WAP 1.* (WAP Forum 1998, 2000)

  • A specification (standard) for delivering and presenting information on mobile (wireless) devices.
  • A protocol to support development of applications over cellular networks by addressing the unique characteristics of mobile devices such as limited memory, limited bandwidth, varying configurations etc.
  • Specifically designed for access to Internet and other advanced telephony services from mobile phones
  • GPRS and 3G are more suited for WAP though it can be used from a variety of networks
  • WAP can be accessed from different networks such as GSM, GPRS, CDMA, TDMA, i-mode, 3G systems (IMT-2000, UMTS, W-CDMA).

WAP Architecture

  • WAP is based on layered architecture
  • The WAP protocol stack is based on the OSI network model.
  • The protocol suite allows the interoperability of WAP equipment and software with

many different network technologies, thus allowing the building of a single platform for

competing network technologies such as GSM and IS-95 (also known as CDMA)

networks

WTLS

  • An optional layer, provides a public-key cryptography-based security mechanism similar to TLS
  • Provides different levels of security for privacy, data integrity, and authentication
  • Optimized for low-bandwidth, high-delay bearer networks. And also takes into account the low processing power and very limited memory capacity of the mobile devices for cryptographic algorithms

WTP

  • Provides transaction support(reliable request/response) adapted to the wireless world  Provides improved reliability over datagram services  Improved efficiency over connection-oriented services  Support for transaction-oriented services such as web browsing.
  • Ability to provide a user acknowledgment

WSP/B

  • Think of WSP initially as a compressed version of HTTP
  • Provides a shared state between a client and a server to optimize content transfer.
  • Normally HTTP is a stateless, which causes many problems in fixed networks  Stateless means that all HTTP transactions are independent of each other. HTTP doesn’t remember any transaction, request, or response.  For every page, image, text or whatever resource, HTTP makes repeated requests/responses to the server  Use cookies to store some state in the client, for instance to resume connections, etc
  • WSP is a protocol to replace HTTP in the wireless domain
  • WSP provides the following functionalities  Session management for wireless devices  Capability negotiation  Content encoding – WSP also defines the efficient binary encoding for content it transfers. HTTP is text based (human readable) whereas WSP is binary. 
  • WSP comprises protocols and services most suited for browsing type applications. In addition to the general features of WSP/B for session management, it provides the following basic features adapted to web browsing  HTTP/1.1 functionality  Exchange of session headers  Push and pull data transfer  Asynchronous requests: client sends multiple requests to a server simultaneously.

Wireless Application Environment (WAE)

  • The primary objective of the WAE is to provide an interoperable environment to build services in wireless space. It covers system architecture relating to the user agents, networking schemes, content formats, programming languages and shared services based on WWW technologies.  Provides facilities like user agent (browser or client program)  XHTML, WML and WMLScript  Wireless Telephony services
  • WAE architecture allows all content to be hosted on standard Web servers. All contents are located using WWW standard URLs. WAE enhances some of the WWW standards to reflect some of the telephony network characteristics
  • WAP Push Architecture: mechanisms to allow origin servers to deliver content to the terminal without the terminal requesting for it.
  • Content formats: set of well-defined data formats, including images, phone book records and calendar information

Interactive Voice Response (IVR)

  • Accessing applications and services through voice interfaces.
  • The technical name for this is Computer Telephony Interface (CTI)
  • IVR software can be hosted on a Windows, Linux or other computers with the voice cards
  • IVR works as the gateway between a voice based telephone system and a computer system
  • Dialogic voice driver is an example of

WAP Gateway

  • Communication between the WAP gateway and the HTTP server uses normal web protocols (i.e. HTTP over TCP/IP).
  • The WAP gateway may be run by the cell phone carrier or a third party gateway provider
  • A WAP request from the browser (user agent) is routed through a WAP gateway. The gateway acts as an intermediary between the client and network through a wireless last mile (GSM, GPRS, CDMA, etc).
  • The gateway does encoding and decoding of data transferred from and to the mobile user agent. The purpose of encoding/decoding is to minimize the size of data transacted over-the- air. That is reduced data size. Reduced data size reduces the computational power required by the client to process the data.
  • In most cases, the WAP gateway resides in TCP/IP network. The server processes the request, retrieves contents from the server using Java servlets, J2EE, CGI scripts or some other dynamic mechanism. The data is formatted as WML and return to the client.
  • Its role is to:  physically link the wired and wireless networks  translate between web protocols (HTTP and TCP/IP) and WAP protocols (WSP, WTP etc)  perform encoding(compression) - WML is stored on the HTTP server in text format, the gateway converts it to binary format for transmission

Wireless Markup Language

  • WML is tag-based document manipulation language
  • Shares a heritage from HTML
  • WML is designed to specify for presentation and user interaction on mobile phones and other wireless devices
  • Implements a deck and card metaphor

Deck

  • Deck is a logical representation of a document
  • Decks are made up of multiple cards
  • Each WML card, in a deck, performs a specific task for a particular user interaction
  • To access a document, a user navigates to a card; reviews its contents, makes a choice or enters requested information, and then moves to another card
  • WML decks can be stored in 'static' files and fetched by CGI, JSP, or ASP scripts, It can also be dynamically generated by a Java servlet running on an origin server

WML Features

  • Support for text and images -> rendering of text and images to the user. It contains limited number of text-markup elements. Example: emphasis(I, b, u), line breaks, tab columns, etc
  • User input support -> elements to solicit user input: text entry(text, password fields), option selection, navigate among cards, invoke scripts, etc
  • Task Invocation controls -> navigation through links, etc
  • International Support -> universal character set or Unicode 2.
  • Narrow band optimization -> comprises of different technologies to optimize traffic on a narrow band device. This includes the ability to specify multiple user interactions (cards) in one document transfer.
  • State and Context management -> creation of variables is supported. The life time of a variable can be extended beyond a single deck. The state can be shared among multiple decks

WML is mostly about rendering text. Many tags that are available in HTML and demand a high resource are generally not supported in WMLThe use of tables and images is restricted.Similar to XML, WML tags are case sensitive.

Creating WML documents

  • Use normal text editors for writing
  • Two important things to precede the document: xml headers, deck and cards

Hello world

This is another text

  • Instead of pages, WML sites have cards. This is what is going to be displayed on the screen at one time, just like a page. More than one card can be inserted in a deck

Navigation

  • Use menus to provide list of preferences for the user
  • Use tag to link to cards together
  • **** element is similar to tag. The element can be combined with the

and to support navigation between cards where the destination is specified

softkeylabel

Tables

  • Tables can be used inside

Row 1

Images

  • WML is restricted in its support for images
  • WML only supports wireless bmp (wbmp) image format.

Events and Timer Events

  • Timer events are ones that occur after a set amount of time. One of the basic ways in

which the timer event can be used is the introduction of a “Splash Screen”

  • A splash screen is one that is displayed when a program first runs and provides such

information as the name of a company, the name and version of a program, a company

logo or other information

  • Example: use of timer for introductory page

WELCOME TO THE STATE CAPITAL PROGRAM

Northeast

Southeast

Midwest

Southwest

West

Pop

$(pop)

County

$(county)

  • Use event in conjunction with element to prompt the user for input.

The following example shows a WML document using to assign data to a variable

Hello $(user). Please select a region.

Southeast

Midwest

Northeast

Southwest

West

Alabama

Arkansas

Florida

Georgia

Louisiana

Mississippi

North Carolina

South Carolina

Tennessee

Virginia

HTML5 for Mobile Apps

  • HTML5 is an extension of HTML4 and XHTML, which in common use on the World Wide Web are a mixture of features introduced by various specifications. HTML5 introduces a number of new elements and attributes that reflect typical usage on modern websites.
  • It includes detailed processing models to encourage more interoperable implementations; it extends, improves and rationalises the markup available for documents, and introduces markup and application programming interfaces (APIs) for complex web applications.
  • HTML5 is also a potential candidate for cross-platform mobile applications. Many features of HTML5 have been built with the consideration of being able to run on low-powered devices such as smartphones and tablets.
  • In particular, HTML5 adds many new syntactical features. These include the new , and elements, as well as the integration of scalable vector graphics (SVG) content that replaces the uses of generic tags and MathML for mathematical formulae.
  • These features are designed to make it easy to include and handle multimedia and graphical content on the web without having to resort to proprietary plugins and APIs. Other new elements, such as , , and, are designed to enrich the semantic content of documents.
  • Some rules for HTML5 were established: o New features should be based on HTML, CSS, DOM, and JavaScript o Reduce the need for external plugins (like Flash) o Better error handling o More markup to replace scripting o HTML5 should be device independent o The development process should be visible to the public
  • The following are the most important additions of HTML o New elements o New attributes o Full CSS3 support o Video and Audio – [, ] o 2D and 3D graphics - [based on canvas 2D specification and using css3 2d/3d] o Local storage o Local SQL database o Document editing [, , ] o Geolocation o New form controls, like calendar, date, time, email, url, search

Developing Offline Apps

  • Offline apps involve developing web apps that can operate while offline. W hile offline, users

are dependent on their HTTP cache to obtain the application at all, since they cannot

contact the server to get the latest copy.

  • The HTML 5 specification provides two solutions to this: a SQL-based database API for

storing data locally, and an offline application HTTP cache for ensuring applications are

available even when the user is not connected to their network.

1) SQL
  • The client-side SQL database in HTML 5 enables structured data storage. This can be

used to store e-mails locally for an e-mail application or for a cart in an online shopping

site. The API to interact with this database is asynchronous which ensures that the user

interface doesn't lock up. Because database interaction can occur in multiple browser

windows at the same time the API supports transactions.

  • To create a database object you use the openDatabase() method on

the Window object. It takes four arguments: a database name, a database version, a

display name, and an estimated size, in bytes, of the data to be stored in the database.

For instance:

var db = openDatabase("notes", "", "The Example Notes App!", 1048576);

  • On the above database, you can use the transaction() method.

2) Offline App Caching API

  • The mechanism for ensuring Web applications are available even when the user is not

connected to their network is the manifest attribute on the html element.

  • The attribute takes a URI to a manifest, which specifies which files are to be cached.

The manifest has a text/cache-manifest MIME type. A typical file looks like this:

CACHE MANIFEST index.html help.html style/default.css images/logo.png images/backgound.png NETWORK: server.cgi

  • This file specifies several files to cache, and then specifies that server.cgi should never

be cached, so that any attempt to access that file will bypass the cache.

  • The manifest can then be linked to by declaring it in the (HTML) application, like this: