The next generation of mobile communicators is here, and
delivering content to them will mean programming in WML
(Wireless Markup Language) and WMLScript, the languages of
the Wireless Application Environment (WAE). The WAE allows
information in almost all applications to be formatted for
display on mobile devices, such as cell phones, and enables
the user to interact with the information.
Why learn yet another technology? According to some
estimates, 75 percent of web document viewing by the year
2002 will be through non-desktop devices, many using
wireless technologies. Clearly, the future is wireless. For
web developers who want to get up to speed quickly in these
languages, Learning WML & WMLScript maps out in detail
the WAE and its two major components, WML and
WMLScript.
Fortunately, the WAE provides a World Wide Web-like
model for writing applications, incorporating several key
features of the Web to ease the transition for developers.
Almost all wireless applications can be written with WML,
which replaces HTML in the wireless environment, and
WMLScript, which replaces JavaScript. With this book, web
developers with some knowledge of programming and C, Java,
or JavaScript syntax can easily master both languages.
Contents Preface
1. Introduction to WML
A Complete Example
Cards
Empty-Element Tags
Elements
Attributes
Entities
Comments
2. WML Variables and Contexts
Variable Substitution
Setting Variables
Browser Contexts
3. WML Tasks and Events
Tasks
Events
4. WML User Interaction
Problems with Web Interaction
Interaction in WAP
The <input> Element
The <select> Element
The <option> Element
The <optgroup> Element
The <do> Element
The <anchor> Element
The <a> Element
The tabindex Attribute
5. WML Timers
Using Timers with WML
The <timer> Element
6. WML Decks, Templates, and Cards
The <wml> Element
The <head> Element
The <access> Element
The <meta> Element
The <card> Element
The <template> Element
7. WML Text and Text Formatting
The <p> Element
The <br> Element
Character Formatting
Tables
8. WML Images
The <img> Element
The WBMP Image Format
9. Introduction to WMLScript
WMLScript with WML
What Is WMLScript?
10. WMLScript Datatypes, Variables, and
Conversions
Datatypes and Literals
Variables
Type Conversion
11. WMLScript Operators and Expressions
Operand Conversions
Assignment Operators
Arithmetic Operators
Bitwise Operators
Shift Operators
Logical Operators
Increment and Decrement
Operators
Comparison Operators
Type Operators
The Conditional Operator
The Comma Operator
Precedence and Associativity
12. WMLScript Statements
Expressions as Statements
Blocks of Statements
Conditions
Loops
Returning from a Function
Other Statements
13. WMLScript Functions
Function Declarations
Function Calls
Calls to Other Script Units
Calling WMLScript from WML
Standard Libraries
14. WMLScript Pragmas
The access Pragma
The meta Pragma
15. The Lang Library
abort
abs
characterSet
exit
float
isFloat
isInt
max
maxInt
min
minInt
parseFloat
parseInt
random
seed
16. The Float Library
ceil
floor
int
maxFloat
minFloat
pow
round
sqrt
17. The String Library
charAt
compare
elementAt
elements
find
format
insertAt
isEmpty
length
removeAt
replace
replaceAt
squeeze
subString
toString
trim
18. The URL Library
escapeString
getBase
getFragment
getHost
getParameters
getPath
getPort
getQuery
getReferer
getScheme
isValid
loadString
resolve
unescapeString
19. The WMLBrowser Library
getCurrentCard
getVar
go
newContext
prev
refresh
setVar
20. The Dialogs Library
alert
confirm
prompt
21. Complete Examples
Calculator
Battleships
A. Absolute and Relative
URLs
B. WAP Gateways and WSP
C. Summary of WMLScript
Operators
D. Serving WAP Content from a
Standard Web Server
Index