Upload
vankhanh
View
216
Download
0
Embed Size (px)
Citation preview
http://www.forum.nokia.comProduct number: SDK-01-000-001Version 1.3 November 1999
Getting StartedNOKIA WAP TOOLKIT
Version 1.3
© 1999. Nokia Corporation. Nokia is a registered trademark of Nokia Corporation.
Getting StartedNOKIA WAP TOOLKIT
Version 1.3
Product number: SDK-01-000-001
Copyright © Nokia Corporation 1999. All rights reserved.
We welcome and consider all comments and suggestions. Please send them to:
Nokia Group FinlandP.O. Box 226,FIN-00045 NOKIA GROUP
Tel. +358 9 180 71Fax. +358 9 656 388
Internet mail address:[email protected]
http://www.forum.nokia.com
This document is part of the Nokia Wireless Application Protocol Toolkit. Reproduction, distributionor transmission of part or all of this documentation in any form without the prior written permission ofNokia is prohibited.
The content of this documentation may be changed without prior notice.
“Nokia,” the arrows symbol and Nokia’s product names are trademarks of Nokia.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of SunMicrosystems, Inc. in the United States and other countries.
Microsoft, Windows, and Windows NT are registered trademarks of Microsoft Corporation.
Portions of the Nokia WAP Toolkit contain technology used under license from the World Wide WebConsortium and are copyrighted by the World Wide Web Consortium (Massachusetts Institute ofTechnology, Institut National de Recherche en Informatique et en Automatique, Keio University).
NOKIA WAP TOOLKIT i
Contents
Introduction ............................................................................................1Nokia WAP Toolkit .............................................................................................................2
User interface simulator.................................................................................................3Editors ................................................................................................................................3Debugger ...........................................................................................................................3
Typographical conventions.................................................................................................3Related documents................................................................................................................4
Documents included in the Nokia WAP Toolkit...................................................4Other references...............................................................................................................4
Installation...............................................................................................5System requirements.............................................................................................................5Installation procedure...........................................................................................................6Files included in the Nokia WAP Toolkit......................................................................7Setting the MIME types.......................................................................................................9
Overview of WAP and WML............................................................. 11Components of the WAP..................................................................................................11Introduction to WML ........................................................................................................14
Deck and card.................................................................................................................14Wireless Markup Language Script...................................................................................15
WML and WMLScript example................................................................................16
Nokia WAP Toolkit ............................................................................. 17Using the Nokia WAP Toolkit application..................................................................17
Using views.....................................................................................................................19Modifying WAP Toolkit preferences ......................................................................25Using the mobile phone display................................................................................33Handling variables ........................................................................................................35Entering an URL ...........................................................................................................36Opening a local file .......................................................................................................36
Creating a simple WML deck...........................................................................................38Viewing error and status information ............................................................................40Using bookmarks.................................................................................................................41Using the WML and WMLScript editor .......................................................................42Using the WBMP editor ....................................................................................................43
Index ...................................................................................................... 47
Getting Started
ii NOKIA WAP TOOLKIT
NOKIA WAP TOOLKIT 1
Introduction
This guide provides information and practical examples for developers who use theNokia WAP Toolkit tools to create services on the WAP platform. The guide helpsyou to install and use the Nokia WAP Toolkit software.
The Nokia WAP solution brings the content of HTML applications to mobiledevices. The user can access public web services and corporate information using aWAP-enabled phone. The WAP gateway transforms the information to a formatsuitable for mobile networks and devices. The content provider can also createWML applications specifically for the mobile environment.
Corporate Databases
Email, groupware
Corporate Web Server
Internet
Private IP Networks
Wirelessnetwork
WAP Gateway
HTML/WML
HTML/WML
WML/WMLScriptWAP SDK
WML/WMLScript
Wireless Application Protocol and Nokia WAP Toolkit.
The Nokia WAP Toolkit offers developers an environment for creating, testing anddemonstrating WAP applications. This allows service providers to test the usabilityof wireless applications and services with customers.
The Nokia WAP Toolkit software includes the following:
n WML and WMLScript encoders
n WAP simulation client with generic mobile phone user interfaces
n WAP application debugging support
n User documentation
Getting Started Introduction
2 NOKIA WAP TOOLKIT
The Nokia WAP Toolkit simulates a generic WAP mobile phone (you can choosefrom three models), later referred to as user agent. A WAP user agent is similar to aweb browser with the distinction that in the WAP environment Uniform ResourceLocators (URLs) are requested over conventional cellular networks. The URLrequest is sent to a web server containing Wireless Markup Language (WML) andWireless Markup Language Script (WMLScript) services. These services respond tothe requests using WML and WMLScript.
WML is based on the Extensible Markup Language (XML) and was developed bythe Wireless Application Protocol (WAP) Forum for specifying content and theuser interface for narrowband devices such as mobile phones.
WMLScript can be used to add client side procedural logic to WML cards anddecks. The language is based on ECMAScript, but has been modified to bettersupport low bandwidth devices such as mobile phones. You can use WMLScriptalong with WML to provide intelligence to the client, or you can use it as a stand-alone tool.
Nokia WAP Toolkit
The Nokia WAP Toolkit provides tools for creating services on the WAP platform.It includes the following components:
n The Nokia WAP Toolkit application for Windows NT 4.0, Windows 95, andWindows 98, which simulates the behavior of WML and WMLScript andallows you to create, edit and debug WML and WMLScript services. Thesimulation client includes the following components:
— WML browser, including WMLScript interpreter and WMLScript libraries
— WAP phone user interface simulation module
— WML and WMLScript encoders
— WML, WMLScript, and WBMP editors
— WAP Protocol Stack, HTTP and file access modules
— Debugging views
n An installation utility and practical WML example applications and sourcecode. You can use these samples as a starting point for creating your ownservices.
n XML library that you can use to construct valid WML documents for use byserver-side components, or for general use. The library only allows you tocreate valid content, as validated by the standard DTD for WML1.1.
n User documentation in Adobe PDF format, including a Developer’s Guide andWML and WMLScript language references.
The components of the Nokia WAP Toolkit software can be divided into threemain categories, discussed below.
Introduction Getting Started
NOKIA WAP TOOLKIT 3
User interface simulatorThe simulator application reads the WML or WMLScript and shows theapplication in the user interface simulation window, simulating the look and feel ofa mobile phone user interface.
EditorsWAP applications are created in WML and WMLScript. The Nokia WAP Toolkitincludes a text editor for writing WML and WMLScript code. The application datais loaded from a local file.
The Nokia WAP Toolkit also includes an editor for creating and modifying WBMPfiles.
DebuggerThe Nokia WAP Toolkit includes a tool that displays useful debugging informationsuch as variable values. The WML browser logic component decodes bytecode andmaintains Wireless Application Environment state information such as history andvariables.
Typographical conventions
The following typographical conventions are used in this guide:
Notation Explanation
Courier Text that you enter and that appears onscreen,program code, file and directory names, functionnames.
Courier Bold Uniform Resource Locators and commands to betyped exactly as shown.
Italic References to other guides and documents, newterminology.
Bold Names of Windows menus, commands, buttons andicons.
Getting Started Introduction
4 NOKIA WAP TOOLKIT
Related documents
The following documents contain additional information on the Nokia WAPToolkit and the Wireless Application Protocol. The web address provided aftereach document specifies the Internet location where the document can be obtained.
Documents included in the Nokia WAP Toolkitn Nokia WAP Toolkit Developer’s Guide
This guide provides information on the Nokia WAP Toolkit and the WirelessMarkup Language for developers who want to create their own wirelessservices on the WAP platform.
n WML Reference
This guide provides reference information on the Wireless Markup Language(WML). It introduces the WML syntax and provides code examples.
n WMLScript Reference
This guide provides reference information on the WMLScript language. Itintroduces the WMLScript and its standard libraries.
Other references
n Wireless Markup Language Specification.WAP Forum, 16-June-1999.http://www.wapforum.org/
n WMLScript Specification.WAP Forum, 16-June-1999.http://www.wapforum.org/
n Wireless Application Environment Specification.WAP Forum, 16-June-1999.http://www.wapforum.org/
n Wireless Application Protocol Architecture Specification.WAP Forum, 16-June-1999.http://www.wapforum.org/
n Wireless Session Protocol Specification.WAP Forum, 16-June-1999.http://www.wapforum.org/
NOKIA WAP TOOLKIT 5
Installation
This chapter describes the system requirements and installation procedure of theNokia WAP Toolkit.
System requirements
Before installing the Nokia WAP Toolkit, check that your system meets thefollowing hardware and software requirements.
n To run the WAP Toolkit application, you need a computer with the following:
— Windows NT 4.0 with Service Pack 3 running on Intel hardware, orWindows 95, or Windows 98.
— 266 MHz Pentium or faster processor.
— 20 MB hard disk space.
— 64 MB of RAM or more.
— Display capable of showing 65.000 colors or more.
— Java™ Runtime Environment 1.2.2 or later must be installed. You candownload it from the Sun Microsystems web site athttp://www.javasoft.com/products/jdk/1.2/jre/index.html
n To test services available on the Internet, you need an Internet connection.
n To test your own services, you need an HTTP 1.1-compliant web server. Notethat you can also load the services directly from a local file.
Getting Started Installation
6 NOKIA WAP TOOLKIT
Installation procedure
To install the Nokia WAP Toolkit:
1 Make sure you have the most recent copy of the Nokia WAP Toolkit.
— You can download the most recent copy from the Nokia web site athttp://www.forum.nokia.com
— The Nokia WAP Toolkit file that you can download from the web site is asingle executable installation file setupex.exe .
2 Run setupex.exe.
— Choose Run from the Windows Start menu.
— In the Run dialog box that appears, enter the path of the setupex.exe fileand click OK.
OR
— Using the Windows Explorer, browse to the directory where the NokiaWAP Toolkit installation file setupex.exe is located.
— Double-click the file setupex.exe.
3 Follow the onscreen instructions. Setup has the following buttons at thebottom of the dialogs:
— Next: Click this to accept the current input and continue with setup.
— Back: Click this to return to the previous dialog.
— Cancel: Click this to exit setup.
During the Nokia WAP Toolkit installation, the following actions areperformed:
— The Nokia WAP Toolkit files are copied to the specified directory. Thedefault location is C:\Program Files\Nokia\Nokia WAP Toolkit
— A Nokia WAP Toolkit menu is added to the Programs section of theStart menu. With setup you can also specify another program group.
Installation Getting Started
NOKIA WAP TOOLKIT 7
To uninstall the Nokia WAP Toolkit:
1 From the Start menu, select Settings - Control Panel.
The Control Panel appears.
2 Double-click the Add/Remove Programs icon.
The Add/Remove Programs dialog appears.
3 In the scrolling list, select “Nokia WAP Toolkit” and click Add/Remove.Confirm that you want to uninstall the Toolkit.
The Nokia WAP Toolkit files and registry entries are removed from yourcomputer.
! Note: You cannot uninstall the Nokia WAP Toolkit completely by manuallydeleting the Toolkit files and directories.
Files included in the Nokia WAP Toolkit
The following table gives you an overview of the files and directories in a typicalinstallation of the Nokia WAP Toolkit.
The default installation directory isC:\Program Files\Nokia\Nokia WAP Toolkit
File or directory name Description
_deisreg.isr Installation utility.
DelsL1.isu Installation utility.
license.txt The Nokia WAP Toolkit license agreement.
rel_note.txt Release Notes for the Nokia WAP Toolkit, providesinstructions on using the software and other essentiallast-minute information on it.
Toolkit.exe The Nokia WAP Toolkit application file. Theapplication can be started from this file; it checks thatyou have Java Runtime Environment 1.2.2 or laterinstalled and then launches the Nokia WAP Toolkit.
Getting Started Installation
8 NOKIA WAP TOOLKIT
File or directory name Description
w3c-http.jar World Wide Web Consortium’s HTTP Java libraries.
wapsdk.ini Configuration file of the Nokia WAP Toolkit.
wapsdk.jar Executable Java file of the Nokia WAP Toolkit. Theapplication can be started from this file.
waptools.jar Contains the server library.
wmlencoder.jar WML content encoder Java libraries.
WMLScriptEncoder.jar Executable Java file of the WMLScript contentencoder.
DTD\wml_1.1.xml WML Document Type Definition file.
docs\ The documentation of the Nokia WAP Toolkit inAdobe Acrobat format. The directory contains thefollowing files:
devguide.pdfgs.pdf
wml_ref.pdfwmls_ref.pdf
This directory also includes the apidocs.zip file,which contains an api description of the serverlibrary.
samples\ Example applications created using WML andWMLScript. The directory contains the followingexample files:
cloudy.wbmpcurrency.wmlcurrency.wmlccurrency.wmlsdeck1.wmldeck2a.wmldeck2b.wmldeck3.wmlgetCapital.wmlsmortgage.wmlmortgage.wmlsMultiCard.wml
partcldy.wbmprainy.wbmpreadme.wmlsunny.wbmpweather.wmlweather.wmlcWelcome1.wmlWelcome2.wmlWelcome3.wmlwindex.wmlwindex.wmls
Server Samples Contains GenerateWML.java, a simple exampleshowing how to use waptools.jar. See ReadMe.txtfor more information.
Installation Getting Started
NOKIA WAP TOOLKIT 9
Setting the MIME types
Before creating your own WML services, make sure that your web server supportsthe following MIME types:
Content MIME type Extension
WML source text/vnd.wap.wml wml
Wireless bitmaps image/vnd.wap.wbmp wbmp
Compiled WML application/vnd.wap.wmlc wmlc
WMLScript source text/vnd.wap.wmlscript wmls
Compiled WMLScript application/vnd.wap.wmlscriptc wmlsc
To find out how to set the MIME types for your web server, contact your servervendor.
Getting Started Installation
10 NOKIA WAP TOOLKIT
NOKIA WAP TOOLKIT 11
Overview of WAP andWML
This chapter introduces the Nokia WAP Toolkit components and describes howthey work together. In addition, the chapter shortly discusses the characteristics ofWML and WMLScript.
Components of the WAP
The Wireless Application Protocol standard specifies two essential elements ofwireless communication: an end-to-end application protocol and an applicationenvironment based on a browser. The application protocol is a layeredcommunication protocol that is embedded in each WAP-enabled user agent. Thenetwork side includes a server component implementing the other end of theprotocol that is capable of communicating with any WAP user agent. Often theserver component takes the role of a gateway routing the requests from the useragent to an application server. The gateway can be physically located in a telecomnetwork or a computer network, building a bridge between the two networks. Thefollowing picture illustrates the WAP network structure.
WIRELESS NETWORK
COMPUTERNETWORK
WAPIP
WAP GATEWAY
WIRELESSTERMINAL
APPLICATIONSERVER
WAP network structure.
Getting Started Overview of WAP and WML
12 NOKIA WAP TOOLKIT
A WAP application consists of a server application and a client application that thegateway downloads from the application server to the user agent for execution. Astandard application environment is needed so that the same client application canbe run on different mobile user agents. WAP provides such a standard, consistingof a browser and a script interpreter. The browser is very similar to a web browserand can handle content described in Wireless Markup Language. The browser alsohas a built-in script interpreter for running applications in the user agent. Theseapplications are written in a script language called WMLScript. In addition to theprogramming language itself, the script interpreter also implements a set of librariesthat allow the application to access certain services of the user agent. WML andWMLScript are designed for use in wireless, narrowband networks, and they areboth binary encoded for optimum transmission efficiency.
The WAP protocol has four layers:
n Session layer
n Transaction layer
n Security layer
n Datagram layer
The following picture illustrates the WAP protocol architecture. For reference, thepicture also contains a typical Internet protocol stack.
Internet
HTMLJavaScriptTM
HTTP
TLS - SSL
TCP/IPUDP/IP
SMS USSD CSD IS-136 CDMA CDPD PDC-P Etc..
Bearers:
Wireless Application Protocol
Wireless ApplicationEnvironment (WAE)
Wireless Session Layer (WSP)
Wireless Transport Layer Security (WTLS)
Wireless Datagram Protocol (WDP)
Other Services and
Applications
Wireless Transaction Protocol (WTP)
1
2
3
4
WAP and Internet protocol stacks.
In most cases, the actual application or other content is located on a web server.The content can be native WAP, created with WML and WMLScript, or it can beHTML. Some gateways are capable of translating HTML into WML.
In WAP, the content and the applications are addressed with an URL, in the sameway as in other Internet protocols. The following picture illustrates this.
Overview of WAP and WML Getting Started
NOKIA WAP TOOLKIT 13
Web Server
Content
CGIScripts
etc.
WM
L D
ecks
with
WM
LSc
ript
WAP Gateway
WML Encoder
WMLScriptEncoder
Protocol Adapters
Client
WML
WML-Script
Etc.
HTTPWAP
1 2 3
4
56
7
WAP network protocol structure.
The WAP is similar to a Web model, and operates as follows:
1 The user presses a phone key that has an URL request assigned to it.
2 The user agent sends an URL request to a WAP gateway using the WAPprotocol.
3 The WAP gateway creates an conventional HTTP request for the specifiedURL and sends it to the web server.
4 The HTTP request is processed by the web server. The URL may refer to astatic file or to a CGI or other script application. In the first case, the webserver fetches the file and adds an HTTP header to it. If the URL specifies ascript application, the web server runs the application.
5 The web server returns the WML deck with the added HTTP header or theWML output from the CGI or other script application.
6 The WAP gateway verifies the HTTP header and the WML content andencodes them to binary form. The gateway then creates a WAP responsecontaining the WML and sends it to the user agent.
7 The user agent receives the WAP response. It parses the WML response anddisplays the first card of the WML deck to the user.
For more information on the WAP protocol, refer to the guides listed in the section“Related documents” on page 4.
Getting Started Overview of WAP and WML
14 NOKIA WAP TOOLKIT
Introduction to WML
The Wireless Markup Language is a page description language that describes howWAP content is presented to the user. With WML you can display information ona mobile phone, give the user input options, and specify how the user agent shouldrespond when the user activates a user interface function or presses a key.
For a more comprehensive presentation on the WML language, refer to the WMLReference, included in the Nokia WAP Toolkit.
Deck and card
The basic unit of WML is the card, which specifies a single interaction between theuser agent and the user. Cards are grouped together into decks . A deck is the top-most element of a WML document. When a user agent receives a deck, it typicallyactivates the first card in the deck unless directed to a different card as specified bythe requesting URL in its reference section.
Deck
CardCard
CardCard
CardCard
CardCard
WML deck and cards.
The first example
The following is a simple WML deck containing a single card:
<?xml version="1.0"?> <!-- 1 --><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <!-- 2 --><wml> <!-- 3 -->
<card id="First_Card" title="First Card"> <!-- 4 --><p> <!-- 5 -->The first WML example <!-- 6 --></p> <!-- 7 -->
</card> <!-- 8 --></wml> <!-- 9 -->
1 The first line is a standard XML instruction required by all XML documents.
2 The second line is the XML document type declaration, also required by allXML documents that use external document types, as does WML.
Overview of WAP and WML Getting Started
NOKIA WAP TOOLKIT 15
3 The third line is the root element of the XML document of which there mayonly be only one and it must match the root element name as indicated in thefirst argument of the document type. All WML documents must begin with a<wml> tag and end with a </wml> tag.
4 The following lines define a card containing a start tag and an end tag and textto be displayed to the user.
! Note: The id attribute values cannot contain spaces.
When a user agent loads the deck, it is displayed as shown below.
A WML deck with a single card.
For more information on the WML elements, refer to the WML Reference andDeveloper’s Guide.
Wireless Markup Language Script
The Wireless Application Protocol (WAP) includes WMLScript, a scriptinglanguage that you can use together with Wireless Markup Language to provideintelligence to the client services. WMLScript can also be used as a stand-alone tool.
WMLScript is part of the WAP application layer, and you can use it to add clientside procedural logic to WML cards and decks. The language is based onECMAScript, but it has been modified to better support low bandwidth devicessuch as mobile phones.
With WMLScript, you can overcome the following restrictions of WML:
n Check the validity of user input.
n Access facilities of the user agent. For example, on a mobile phone, allow theprogrammer to make phone calls, send messages, add phone numbers to theaddress book or access the SIM card.
n Generate messages and dialogs locally, thus allowing alerts, error messages,confirmations etc to be seen faster by the user.
n Allow extensions to the user agent software and configure a user agent after ithas been deployed.
For a detailed presentation of the WMLScript, refer to the WMLScript Reference .
Getting Started Overview of WAP and WML
16 NOKIA WAP TOOLKIT
WML and WMLScript exampleThe next example illustrates a WML deck containing two cards and a WMLScript:
n The first card (card1) calls the WML script random.wmls and requests thefunction getRandom that generates a random number.
n The second card (card2) shows the result of the WMLScript operation.
n The script file random.wmls generates a random number and returns the resultto the second card of the WML deck.
For more information on the WML elements and WMLScript functions of thisexample, refer to the WML Reference and WMLScript Reference.
WML code
<!-- random.wml -->
<wml>
<card id="card1" title="Random Example"><p align="center">
Select Random</p>
<do type="ACCEPT" label="Random"><go href="random.wmls#getRandom()"/>
</do></card>
<card id="card2" title="Random Result"><p>Result: $(RESULT)</p></card>
</wml>
WMLScript code
The script does the following:
n Generates a random number between 0 and 100. The random number is storedin the variable r.
n Sets the variable RESULT with the random value r.
n Sends the result to card2 of the WML file random.wml and refreshes itsvariable values.
extern function getRandom() {var r = Lang.random(100);WMLBrowser.setVar("RESULT", r);WMLBrowser.go("random.wml#card2");
}
NOKIA WAP TOOLKIT 17
Nokia WAP Toolkit
This chapter provides a brief introduction to the Nokia WAP Toolkit applicationand explains how you can use the Nokia WAP Toolkit to work with simple staticWML decks.
Using the Nokia WAP Toolkit application
The Nokia WAP Toolkit application allows you to view WML services just as theywould be presented to an actual user with a WAP mobile phone. You can choose toview different mobile phone models, as explained in “Modifying WAP Toolkitpreferences” on page 25. Note that the 6110 and 6150 mobile phones are not realproducts, but the 7110 mobile phone is.
The Nokia WAP Toolkit includes system-wide Undo, Redo, Cut, Copy, and Pastefunctionality in all editors and text-viewers. You can use the Undo and Redofunctions for up to 100 operations in both the text editor and the WBMP editor.
To start the Nokia WAP Toolkit:
1 Connect your computer to the Internet.
You can view local WML and WMLScript files with the WAP Toolkitapplication. To use resources outside your local network, you must have anInternet connection.
2 Make sure you have installed Java Runtime Environment 1.2.2 or later.
3 From the Start menu, select Programs -> Nokia Wap Toolkit -> Toolkit.
OR
If you are running on Windows NT, go to the command line, switch to theNokia WAP Toolkit installation directory and type the following command:
java -jar wapsdk.jar
Getting Started Nokia WAP Toolkit
18 NOKIA WAP TOOLKIT
! Note: Windows NT sets the PATH variable in a different area than Windows95 and Windows 98. If you are running the Nokia WAP Toolkit on aWindows 95 or Windows 98 system and want to start from command line, youmust set the java.exe in your PATH variable.
The Nokia WAP Toolkit window appears as shown in the picture below. TheNokia phone displays a short welcome message.
The Nokia WAP Toolkit application with the 6150 mobile phone.
Location toolbar
Navigation keys
Keys for text entry
Simulatorview tabs
Debug level control
6150 mobile phone
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 19
Using viewsThe Nokia WAP Toolkit application contains six tabbed views that you can openby clicking the tab at the bottom of the application window. If you cannot see thetabs, select Show on the Toolkit menu and check that the tabbed views are checkedas follows:
To make a view active, click its name. An active view is indicated by a check markin front of the view name.
Messages
The Messages view contains the error and status log, allowing you to view anyerrors that occur in the WML and WMLScript compilation. You can also define thelogging level.
Variables
The Variables view shows all the variables that are set in the active WML orWMLScript. For example, when you open the mortgage.wml file delivered withthe Nokia WAP Toolkit and accept the default values, the application generates theVariables view as follows:
The Variables view allows you to add, edit, and clear variables with the utilities atthe bottom of the view.
Getting Started Nokia WAP Toolkit
20 NOKIA WAP TOOLKIT
History
The History view displays the history stack of the current browser context, that is,all the cards you have visited in the current browser context.
The view also contains buttons for navigating to a selected URL and clearing thehistory stack.
Assume that you visit the following decks in the following order:
1 Currency.wml
2 MultiCard.wml. Note that this deck contains two cards that are activatedthrough a timer.
Now the history stack would look as follows:
The stack puts the URL of the last card visited at the top of the stack. Card3 andcard2 of MultiCard.wml were activated by a timer without the user having tonavigate to them.
Note that the size limit is indicated near the bottom of the view. You can set thissize limit in the General tab of the Preferences dialog (see “Modifying WAPToolkit preferences” on page 25 for more information). If the number of URLsvisited exceeds the size limit, the oldest URL is dropped from the list.
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 21
WML Deck
The WML Deck view shows the code and size of the active WML or WMLScript.For example, when you open the file currency.wml provided with the NokiaWAP Toolkit, the deck code will be displayed in the WML Deck view as follows:
The WMLDeck view contains a drop down menu that allows you to select differentviews of the deck:
n The decoded deck.
n The original source. If the original sources is not available (for instance, when abinary WML file is loaded), the decoded deck displays in this view.
n The undecoded bytecode.
For example, the following figure shows the original view of the currency.wmlfile.
Getting Started Nokia WAP Toolkit
22 NOKIA WAP TOOLKIT
Original source.
The next figure shows the undecoded bytecode view of the same deck.
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 23
Undecoded bytecode view.
Bookmarks
The Bookmarks view contains your browser bookmarks. The view allows you tocreate and delete bookmarks and to navigate to a selected bookmark.
Getting Started Nokia WAP Toolkit
24 NOKIA WAP TOOLKIT
Editor
The Editor view allows you to edit existing WML and WMLScript files and tocreate new files.
When you choose to edit a source file or to create a new file, a new tabbed viewappears at the bottom of the Nokia WAP Toolkit application window. The view islabeled Editor, or if you are editing an existing file, it is named after the file. In thisview you can edit and compile WML and WMLScript code and update the phonedisplay to view the compiled code.
For example, when you open mortgage.wml, the code is displayed as follows:
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 25
Session
The Session view contains a table with three columns:
n URL lists the URL that was loaded.
n MIME-Type lists the URL's MIME-type.
n Size lists the number of bytes loaded.
Each time a new location is laded, an entry is added to the table.
The Total Size number in the lower right corner is the sum of the Size column.
The Reset button clears the table and the Total Size value.
Modifying WAP Toolkit preferencesThe Nokia WAP Toolkit preferences allow you specify various details of thesoftware, for example, the URL of your HTTP proxy.
To open the Nokia WAP Toolkit preferences:
n From the Toolkit menu, select Preferences.
The Preferences dialog has three tabs:
n Communication
n Encoding
n General
Getting Started Nokia WAP Toolkit
26 NOKIA WAP TOOLKIT
On the Communications tab you can choose whether the Nokia WAP Toolkituses HTTP directly to access URLs from the network, or uses WSP protocols tocommunicate through a WAP Gateway, which fetches URLs from the network onthe Toolkit’s behalf and then returns the encoded response. The first method issimpler and more direct. The second method more closely simulates the actualtransmission path of a WAP-enabled phone. Note, also, that if the Nokia WAPToolkit is running phone software directly that uses an imbedded protocol stack,you must use Gateway mode.
Each communication mode, HTTP and Gateway, has a set of parameters you mustspecify.
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 27
If you choose HTTP, the Nokia WAP Toolkit issues HTTP requests directly.There are three optional HTTP client features you may turn on or off:
n To enable use of HTTP cookies, check the appropriate box. Any “Set-Cookie”headers received with HTTP responses will be saved, and future HTTPresponses that qualify (i.e., are in the same realm) will include an appropriate“Cookie” header. Note that you must restart the Nokia WAP Toolkit for thischange to take effect.
n To enable the HTTP cache, check the appropriate box. This enables a (non-persistent) cache that obeys the standard HTTP caching rules. Caching reducesthe need to decode files on each access, and makes navigating backwards faster.Note that you must restart the Nokia WAP Toolkit for this change to takeeffect.
n To use HTTP Authentication, check the appropriate box. This causes theNokia WAP Toolkit to follow the HTTP Basic authentication protocol,prompting (through the phone interface) for a user ID and password when itreceives an Unauthenticated error from a request. To have the Toolkit gothrough an HTTP proxy, check the appropriate box. You also must enter theURL of the proxy server in the “HTTP Proxy URL” field.
If you choose WAP Gateway, all requests are WSP-encoded and sent, using WSPProtocols, to a WAP Gateway. If you use this mode, you must specify the serveraddress, the connection mode, and the port on which the Gateway is listening.
In the Gateway Settings box:
n Enter the IP address of the host on which the gateway is running.
n Choose either Connectionless mode or Connection-oriented mode bychecking the appropriate box.
Connectionless mode is a simple, unreliable protocol. Connection-mode is areliable, more heavy-weight protocol (see the WAP WSP Specification for moredetails.) The WAP Gateway supports both types of connections (both areunsecure). The Nokia WAP Toolkit does not currently support either secureConnectionless or secure Connection-oriented mode.
n Enter the port number for the selected connection mode. The default ports are9200 for Connectionless and 9201 for Connection mode. You will need to getthe correct port number from your WAP Gateway administrator.
For more information on the WAP Gateway, see Nokia WAP Server GettingStarted.
On the Encoding tab, you can choose to use fast encoding and pick a character set.
Getting Started Nokia WAP Toolkit
28 NOKIA WAP TOOLKIT
n To use fast encoding, check the box. While using fast encoding, you will seeonly limited error messages. To see all error messages, do not use fast encoding.
n From the Character Set list box, select a character set used in the Nokia WAPToolkit if the HTTP header does not specify any character set. Note that theeditor uses the specified character set when you compile it.
On the General tab, you specify WML access element, history size limit, andmodel of mobile phone.
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 29
n To enable the use of the WML access element, check the appropriate box.Enabling the access element may cause difficulties when testing services withaccess elements. Therefore we suggest that you do not enable the use ofaccess elements when testing such services.
n To set the size number of entries that display in the History view, enter anumber in the WML History Size box.
n From the Phone Model list box, select a model of the mobile phone to displayin the Nokia WAP Toolkit application window.
! Note: If the mobile phone does not display, select Show from the Toolkitmenu and click WAP Device
You can choose to view different phone models. Note that the 6110 and 6150mobile phones are not real products, but the 7110 mobile phone is.
If you choose the 7110 mobile phone, you should note the following:
Getting Started Nokia WAP Toolkit
30 NOKIA WAP TOOLKIT
— The 7110 model is not available with Nokia WAP Toolkit versions prior to1.3.
— When the 7110 model is active, certain Nokia WAP Toolkit features aredisabled, such as the WML Deck and Session tabs.
— To use the 7110 model mobile phone so that it can access WML cards fromthe WAP Gateway, see the Setting Up Nokia 7110 Phone document forinstructions.
The following figures show the display for each mobile phone model.
6110 model mobile phone.
Scroll up
Scroll down
Soft keys
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 31
6150 model mobile phone.
Scroll up
Select
Scroll down
Soft keys
Getting Started Nokia WAP Toolkit
32 NOKIA WAP TOOLKIT
7110 model mobile phone.
Power button
Soft keys
Roller
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 33
Using the mobile phone displayYou use the soft keys and number pad on the mobile phone display to:
n Choose from menus
n Navigate backwards through the card history
n Navigate to the home deck
n Enter text and numbers
Navigating to the home deck
The Nokia WAP Toolkit provides a way to navigate to the home deck specified inthe WAP Toolkit Preferences.
To navigate to the home deck:
n From the Go menu, select Home .
Navigating backwards
The Nokia WAP Toolkit provides several ways to navigate backwards through thecard history.
To navigate backward to the card visited previously:
n Click the Back button on the WAP phone simulator to return to the card youvisited last.
n From the Go menu, select Back to return to the card you visited last.
n Click the drop-down arrow on the location toolbar to open a list of previouslyvisited decks. From the list, select a deck you visited previously.
n Click the History tab at the bottom of the application window. In the view,select the URL that you want to navigate back to and click Go. Note that thehistory stack only contains the decks that you have visited in the currentbrowser context.
Getting Started Nokia WAP Toolkit
34 NOKIA WAP TOOLKIT
Using menus
To choose an item from the options menu:
1 Click the button with the up and down arrows to highlight the item you want.
2 Click the Options button to the left of the arrows button. The options menuopens, where you select further actions.
Note that if you have specified only one soft key action, the soft key is directlyavailable, and the Options button is not displayed.
Entering characters in the phone display
To enter text and numbers in the phone display, click the mouse on the phonenumber keys, or use your computer keyboard. With the phone number keys, youcan enter both numbers and letters depending on the entry format allowed. A labelin the upper left corner of the phone display indicates the entry format. Forexample, if you are allowed to enter only numbers, the label is [123].
To enter text with the phone number keys:
n To type a K, click on the number key 5 rapidly until the letter K appears.
The following table shows the characters that you can enter with each key.
1
. , ? ! -
2
A B CÄ Å À Á Ã Â Æ Ç
3
D E FÈ É Ë Ê
4
G H IÐ Ì Í Î Ï
5
J K L
6
M N OÑ Ö Ò Ó Ô Ø Õ
7
P Q R S
8
T U VÜ Ù Ú Û
9
W X Y ZÝ Þ ß
* + 0 _
SPACE
# ⇑
To change between uppercase and lower-case characters, press #.
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 35
Handling variables
The Nokia WAP Toolkit allows you to handle variables in the Variables view. Inthis view you can set, edit and clear variables.
To set a variable:
1 In the Name field, type a name for the variable to set.
2 In the Value field, type a value for the variable.
3 Click Set. The variable appears in the variable list.
4 From the Go menu, select Refresh Card. This updates the variable values ofthe current deck.
To edit a variable:
1 In the variable list, click the variable you want to edit.
2 Edit the Name and Value fields.
3 Click Set.
4 From the Go menu, select Refresh Card. This updates the variable values ofthe current deck.
To clear all variable values:
n Click Clear all. Note that this clears the values of the current browser contextonly.
Getting Started Nokia WAP Toolkit
36 NOKIA WAP TOOLKIT
Entering an URLThe Nokia WAP Toolkit provides two ways to enter URLs.
To request a specific URL:
n Type the URL in the Location field and press Enter on your computerkeyboard. For example, http://www.acme.com.
n From the Go menu, select Load location. The following dialog appears:
In this dialog, enter the URL and click Open .
Opening a local fileThe Nokia WAP Toolkit provides two ways to open a local WML or WMLScriptfile.
To open a local WML or WMLScript file:
n Type the URL of the file in the Location field and press Enter on yourcomputer keyboard. For example, file:///d:\WMLExamples\myfile.wml .
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 37
n From the Go menu, select Load file. The following dialog appears:
By default, the dialog displays the contents of the samples directory under theWAP Toolkit installation directory. Select a file and click Open.
If the file that you want to open is stored at another location, click the drop-down arrow in the Look in field and browse to the desired location.
Getting Started Nokia WAP Toolkit
38 NOKIA WAP TOOLKIT
Creating a simple WML deck
This section describes the steps you must follow to create and test a static WMLdeck.
1 From the File menu, select New. Select WML Deck. The following interfaceappears:
Note that the WAP phone display does not show the deck until you update thedisplay by clicking Show.
2 Create the WML.
For example, create a file wmltest.wml containing the following WML:
<wml><card id="First_Card" title="First Card">
<p>The first WML example</p>
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 39
</card></wml>
The section “The first example” on page 14 provides a line-by-line descriptionof this deck.
3 From the File menu, select Save to save the deck.
In the dialog that appears, specify a name for the WML file, for examplewmltest.wml.
! Note: Make sure you save the file as a text-only file and that you save it to afilename ending with the extension .wml.
4 Update the WAP phone display by compiling the deck (click COMPILE) andthen clicking Show.
After the update, the phone displays the WML file as follows:
! Note: If the WAP phone simulator does not display the card correctly, theremay be an error in the WML. See the following section for instructions onchecking error messages.
In the Editor view you can also compile the WML code into binary format.
Getting Started Nokia WAP Toolkit
40 NOKIA WAP TOOLKIT
Viewing error and status information
The Nokia WAP Toolkit application views status and WML error messages in theMessages view of the simulation window. To open the view, simply click on theMessages tab at the bottom of the window.
If the Messages tab is unavailable, select the Show on the Toolkit menu and clickon Messages to activate the Messages view. An active page is indicated by a tickmark in front of the view name.
To select the error message level:
1 Click the Messages tab to open the Messages view.
2 Click the drop-down button in the Message Level box. This opens a drop-down selection list containing six message levels:
— Detail – this generates the most detailed log.
— Debug
— Normal
— Warning
— Error
— Critical – this generates only the most important messages.
3 Choose a level by clicking on its name in the drop-down list.
To clear the browser message log:
n Click Clear at the bottom of the Messages view.
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 41
Using bookmarks
With the Nokia WAP Toolkit, you can add and edit bookmarks.
To add a bookmark:
n From the Toolkit menu, select Add Bookmark.
This adds the current URL to your bookmarks.
To edit bookmarks:
1 Click the Bookmarks tab at the bottom of the application window.
This opens the Bookmarks view, allowing you to edit your bookmarks.
In the above example, the bookmarks already include two decks.
2 Click the bookmark field that you want to edit and write the new value directlyto the field.
— To add a new bookmark, click New . This adds a new blank bookmark atthe end of the bookmark list.
— To navigate to the selected bookmark, click Go.
— To delete the selected bookmark, click Delete.
Getting Started Nokia WAP Toolkit
42 NOKIA WAP TOOLKIT
Using the WML and WMLScript editor
With the WML and WMLScript editor provided with the Nokia WAP Toolkit youcan create new services and edit existing ones.
To edit an existing file:
1 From the File menu, select Open .
The Open dialog appears.
2 Browse to the file that you want to edit, select the file, and click Open .
The file opens in the WML and WMLScript editor.
3 Edit the file and save it by selecting Save on the File menu.
4 Click Compile to convert the code into binary format.
The compiled file appears in the same directory where the current file islocated. The extensions of the compiled files are the following:
— wmlc – compiled WML.
— wmlsc – compiled WMLScript.
5 Click Show to update the WAP phone display to view the code you edited.
To create a new file:
1 From the File menu, select New .
— Select WML Deck if you are creating a WML file.
— Select WMLScript if you are creating a WMLScript file.
2 Follow the instructions on creating a new static WML file described in“Creating a simple WML deck” on page 38.
! Note: Make sure you save the file as a text-only file and that you save it to afilename ending with the appropriate extension:– wml for WML files,– wmls for WMLScript files.
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 43
Using the WBMP editor
The WAP standard specifies an image format called WBMP. The Nokia WAPToolkit includes a WBMP editor that you can use to:
n Create new WBMP images of any size.
n Open existing WBMP images in the editor and modify them, as necessary.
n Import GIF and JPEG images and convert them into WBMP.
n Draw pixels, straight lines, boxes and ellipses with outlines in black or white ofvariable thickness and with a choice of fill-in patterns.
n Zoom in and out of the image in the editor.
n Cut, copy, and paste selected regions of the image.
n Write the finished WBMP images to file.
You can use the WBMP images in your WAP services. For example, theweather.wml file uses bitmaps as shown in the following display:
To create a new bitmap file:
1 From the File menu, select New . Select WBMP Image .
2 A dialog box displays, in which you indicate the dimensions of the new bitmap.
Enter the width and height, in pixels.
Getting Started Nokia WAP Toolkit
44 NOKIA WAP TOOLKIT
3 The WBMP editor interface appears.
4 Use the various tools to create your bitmap image.
5 To save the image, on the File menu, select Save .
! Note: Make sure you save the file to a filename ending with the extension.wbmp.
Undo Redo Copy Select a region Draw a line Line color Fill pattern
Cut Paste Draw a pixel Draw a box Draw an ellipse Line width
Zoom control box X and Y coordinates of cursor
Nokia WAP Toolkit Getting Started
NOKIA WAP TOOLKIT 45
To edit an existing bitmap image:
1 From the File menu, select Open .
The Open dialog appears.
2 Browse to the file that you want to edit, select the file, and click Open .
The file opens in the WBMP editor.
3 Edit the image and save it by selecting Save on the File menu.
Getting Started Nokia WAP Toolkit
46 NOKIA WAP TOOLKIT
NOKIA WAP TOOLKIT 47
Index
66110 mobile phone, 30
6150 mobile phone, 31
77110 mobile phone, 29, 32
BBackwards navigation, 33
bitmap images, 43
Bookmarks, 41
Bookmarks view, 23
CCard, 14
card element, 14
Character map, 34
Creating WML, 38
DDeck, 14
Eediting bitmap images, 43
editing images, 43
Editor view, 24
Entering characters, 34
Error information, 40
FFiles of WAP Toolkit, 7
GGateway settings, 26
HHistory view, 20
Home deck, 33
HTTP settings, 26
Iimage editing, 43
Installing WAP Toolkit, 6
Introduction to WML, 14
LLetters, 34
Local file, 36
Logging, 40
MMessages view, 19
mobile phone display, 33
mobile phone, model 6110, 30
mobile phone, model 6150, 31
mobile phone, model 7110, 29, 32
NNavigating
backwards, 33to a local file, 36to an URL, 36to the home deck, 33
Numbers, 34
Getting Started Index
48 NOKIA WAP TOOLKIT
OOpening
local file, 36URL, 36
Option item, 34
PPreferences, 25
RRelated documents, 4
SSession view, 25
Starting the Nokia WAP Toolkit, 17
Status information, 40
System requirements for WAP Toolkit, 5
TTesting WML, 38
Text, 34
Typographical conventions, 3
UUninstalling WAP Toolkit, 7
URL, 36
User interface, 11
Using bookmarks, 41
Using menus, 34
using the WBMP editor, 43
VVariables view, 19
Views
Bookmarks, 23Editor, 24History, 20Messages, 19Session, 25Variables, 19WML Deck, 21
WWAP Toolkit
components, 2files included, 7installation, 6installing, 5preferences, 25system requirements, 5uninstalling, 7using, 17
WAP TOOLKIT
user interface, 11WBMP editor, 43
Wireless Markup Language, 2
Wireless Markup Language Script, 2, 15
WML. See Wireless Markup Language
card, 14card element, 14creating, 38deck, 14testing, 38wml element, 14
WML Deck view, 21
wml element, 14
WMLScript. See Wireless MarkupLanguage Script