WAP and WML - PowerPoint PPT Presentation

About This Presentation
Title:

WAP and WML

Description:

WAP and WML The Wireless Application Protocol WAP architecture WML document structure WML syntax Basic document syntax Layout Text formatting Images Navigation – PowerPoint PPT presentation

Number of Views:77
Avg rating:3.0/5.0
Slides: 21
Provided by: AlexB154
Category:
Tags: wap | wml

less

Transcript and Presenter's Notes

Title: WAP and WML


1
WAP and WML
  • The Wireless Application Protocol
  • WAP architecture
  • WML document structure
  • WML syntax
  • Basic document syntax
  • Layout
  • Text formatting
  • Images
  • Navigation
  • Events
  • Variables

2
WAP and WML
3
WAP Architecture
  • Client
  • Any WAP-enabled phone, ie any phone which runs
    the Wireless Application Protocol browser
    software
  • No unique hardware is required
  • There are at least 158 different models today,
    according to developer.openwave.com
  • WAP Gateway
  • This is a service provided by your mobile service
    carrier
  • There are at least 51 carriers worldwide who
    offer WAP gateways (developer.openwave.com)
  • The WAP gateway serves several purposes
  • Serve WML, WMLS, and WBMP content
  • Compile WMLScript
  • Compress all content into binary form

4
WAP Architecture
  • Do you still need a web server?
  • Early WAP server designs included an HTML-to-WML
    converter. The theory was that you could serve
    your original content, just reformulate the tags
    into WML in an automated manner. Your web server
    became a back end behind your WAP server the WAP
    server would translate requests from the Gateway,
    through to the web server, and back.
  • This failed painfully. Its clear now that your
    content needs to either be in WML, or you need to
    design for a one-inch-square screen in your HTML.
  • So, if not a web server, then--?
  • Your WAP server is the web server.
  • You can serve both types of content from one
    system.

5
WAP Architecture
  • Follow the request
  • Client establishes a data connection to WAP
    Gateway
  • Client sends WTAI (Wireless Telephony
    Application Interface--HTTP for phones) request
    for URL entered
  • WAP Gateway receives request, decodes it
  • WAP Gateway sends HTTP request to Web Server
  • Web Server replies with content
  • WAP Gateway re-encodes content and sends it back
    to client
  • Client renders content locally

6
WML Documents, Decks and Cards
  • Every WML document must begin with an XML
    declaration and a DTD
  • lt? xml version1.0?gt
  • lt!DOCTYPE wml PUBLIC -//WAPFORUM//DTD WML
    1.1//EN http//www.wapforum.org/DTD/wml_1.1.xml
    gt
  • All WML documents contain one or more cards.
  • Each card contains the content for a single page
    of display.
  • The ltWMLgt tag is the root of the deck.
  • Within the ltWMLgt tag, youll one or more ltcardgts
    and perhaps a ltheadgt tag.

7
WML Syntax
  • ltwmlgt
  • ltheadgt
  • ltcardgt
  • ltcardgt
  • title
  • id
  • newcontext true, false
  • onenterbackward url
  • onenterforward url
  • ontimer url

8
WML Syntax - Layout
  • ltpgt
  • alignleft, right, center
  • modewrap, nowrap
  • ltbr /gt
  • lttablegt
  • columns
  • alignl, c, r
  • lttrgt
  • lttdgt

ltpgt lttable columns"3"gt lttrgt lttdgtCell
1lt/tdgt lttdgtCell 2lt/tdgt lttdgtCell 3lt/tdgt
lt/trgt lt/tablegt lt/pgt
9
WML Syntax - Text Formatting
  • ltbgt - bold text
  • ltbiggt - big text
  • ltemgt - emphasized text
  • ltigt - italicised text
  • ltsmallgt - small text
  • ltstronggt - strong text
  • ltugt -underlined text

10
WML Syntax - Images
  • ltimggt - Render a WBMP file
  • src
  • align top, middle, bottom
  • alt
  • height, width
  • hspace, vspace
  • ltpgt An image
  • ltimg src"stickman.wbmp alt"Stickman"/gt
  • lt/pgt

11
WML Syntax - Navigation
  • As in HTML, you link from page to page explicitly
    with anchors.
  • ltpgt
  • This is a lta hreffoo.wmlgtlinklt/agt
  • lt/pgt
  • WML offers the ltagt tag and the ltanchorgt tag
  • ltagt - the simple anchor tag
  • href
  • ltanchorgt - more powerful anchor tag
  • ltgogt, ltprevgt, ltrefreshgt, ltnoopgt, ...

12
WML Syntax - Navigation
  • A softkey on a mobile phone is a button whose
    function can be set by the software. Most phone
    buttons are softkeys.
  • ltdogt - Map a user softkey to an action similar
    to an anchor tag.
  • label
  • typeaccept, prev, help, reset,
    options, delete, unknown, x-, vnd.
  • accept is the YES button on most phones
    prev is the NO button.
  • When using softkeys, be careful to respect common
    usage rules.

13
WML Syntax - Navigation
  • ltgogt - Navigate to a new card
  • ltprevgt - Back up one on the card stack
  • ltrefreshgt - Reloads the current page
  • ltnoopgt - Do nothing
  • ltsetvargt - Sets a variable
  • ltpostfieldgt - Sends a post (or get) field value
    to the server

14
WML Syntax - Events
  • ltdogt is the softkey event handler.
  • ltoneventgt is a more generalised events handler.
  • typeonenterbackward, onenterforward,
    onpick, ontimer
  • Use onevent to process data differently depending
    on the action of the user.
  • For example, you might want to initialise a
    variable to zero with onenterforward, but then
    incremement it to track user returns in
    onenterback. Onenterback will fire whenever the
    user uses the prev softkey to return to the page.

15
WML Syntax - Timer Events
  • Use the lttimergt tag to initialise a timer.
  • The timers value field specifies 1/10ths of a
    second.
  • The ltcardgt tag defines an ontimer event, whose
    value is a URL. When the lttimergt times out, the
    ltcardgts ontimer URL is loaded.
  • ltcard idcard1 ontimercard2gt
  • lttimer value30gt
  • lt/cardgt
  • ltcard idcard2gt
  • ltpgtHere by timer!lt/pgt
  • lt/cardgt

16
WML Syntax - Variables
  • A variable in a WML script is a data field whose
    value can be changed before the next update.
  • This is a divergence from HTML. HTML does not
    have the concept of variables, because HTML has
    inline JavaScript instead.
  • Variable names, like all concepts in XML, are
    case-sensitive.
  • To refer to a variable in your code, use a dollar
    sign () followed by the name of the variable,
    optionally enclosed in parentheses.
  • foo
  • (foo)

17
WML Syntax - Variables
  • Variables are set with the ltsetvargt tag.
  • Variables, once set, take effect when the page is
    next reloaded. Unfortunately, since ltsetvargt
    runs when an event triggers it, you cant
    initialise variables cleanly.
  • ltcard idBob The Cardgt
  • ltonevent type"onenterforward"gt
  • ltrefreshgt
  • ltsetvar nameFred valueBarney /gt
  • lt/refreshgt
  • lt/oneventgt

18
WML Syntax - Variables
  • Variables can also be set through user input with
    the ltinputgt tag
  • name
  • typetext, password, emptyoktrue, false
  • maxlength, size
  • format nAaNXxMm
  • A / a Uppercase / lowercase alphabetic or
    punctuation
  • N numeric
  • X / x Uppercase / lowercase alphabetic
  • M / m all characters
  • arbitrary number of characters
  • n set number of characters

19
WAP and WML - Recap
  • WAP architecture
  • Client, WAP Gateway, Web Server
  • WML document structure
  • DTDs, decks and ltcardgts
  • WML syntax
  • Basic document syntax - ltwmlgt, ltcardgt, ...
  • Layout - ltpgt, ltbrgt, lttablegt, ...
  • Text formatting - ltbgt, ltigt, ltugt, ltbiggt, ltemgt, ...
  • Images - ltimggt - WBMPs only.
  • Navigation - ltagt, ltanchorgt, ltdogt
  • Events - ontimer, onenterforward,
    onenterbackward, ...
  • Variables - ltsetvargt, ltinputgt, (foo)

20
WAP and WML - Bibliography
  • WAP in Easy Steps, by Mike McGrath. (C)2000
    published by ComputerStep, Warwickshire
  • http//www.w3schools.com/wap/wml_reference.asp -
    a really well-done WML reference
  • http//developer.openwave.com/ - OpenWave are the
    folks whore defining the WAP gateway standards.
    They also make a mobile device SDK.
  • http//www.openmobilealliance.org/documents.html
    - Technical specifications page for the Open
    Mobile Alliance, the public body which binds the
    many corporations investing in WAP and related
    technologies. Note site can be a bit thick.
Write a Comment
User Comments (0)
About PowerShow.com