Mobile Web Developers Guide
Mobile Web Developers Guide
Developer’s Guide
Part I: Creating Simple Mobile Sites for Common Handsets
DotMobi Mobile Web Developer Guide
Copyright © 2007 mTLD. All rights reserved. The contents of this document constitute valuable
proprietary and confidential property of mTLD and are provided subject to the user fully
acknowledging all title, intellectual and proprietary rights vest wholly in mTLD and to specific
obligations of confidentiality and other obligations as may be set forth in one or more binding
legal agreements.
Any use of this material is limited strictly to the uses specifically authorized in the applicable
license agreement(s) pursuant to which such material has been furnished. Any use or disclosure
of all or any part of this material not specifically authorized in writing by mTLD is strictly
prohibited.
Published by mobile Top Level Domain (mTLD), Ltd. 11 Exchange Place, IFSC, Dublin 1, Ireland
dotMobi and the dotMobi logo are trademarks of mTLD. All other company, brand, and product
names are referenced for identification purposes only and may be trademarks that are the sole
While every effort has been made to ensure the accuracy of this Guide, dotMobi accepts no
responsibility for any inaccuracies contained in the text. The information in this Guide is provided
‘as is’, without any warranty of any kind. In no event shall dotMobi be liable for any
consequential, incidental or direct damages suffered by any party in connection with the use of
the information in this Guide. The information in this Guide does not constitute legal or
commercial advice.
DotMobi Web Developer’s Guide 3
1. INTRODUCTION ............................................................................................................................... 5
8. MOBILE PUBLISHING................................................................................................................... 64
SITE NAMING....................................................................................................................................... 66
CONFIGURING SERVER MIME TYPES .................................................................................................. 68
SITE TESTING ...................................................................................................................................... 69
WARNING ............................................................................................................................................ 85
GLOSSARY ........................................................................................................................................... 87
DotMobi Web Developer’s Guide 5
1. Introduction
The Web has revolutionized how we interact with and publish information, but
up to now it has only been accessible to people with desktop devices. Web-
enabled mobile phones now extend the expected global reach of the Web to three
The goal of this guide is to provide developers and site owners with enough
knowledge to get started with the creation of Web content for mobile users. It
covers the benefits of publishing for mobile users, how mobile delivery differs
from desktop delivery and how to design for the mobile context.
Before now, Web publishing for mobile users has been something of a mystery,
partly because of a lack of information. This guide forms part of dotMobi’s efforts
practices and methods and other material describing how to publish for mobile.
The guide aims to provide an introduction for those not familiar with the Mobile
Web. It contains techniques and information required to create a basic site that
will work well on the majority of phones. It is not an encyclopedia of past and
using a .mobi domain is recommended as a clear way to indicate to the user that
a site is mobile-friendly, the advice presented here applies to any mobile site.
1
T-Mobile, Credit Suisse First Boston and Pyramid Research report
DotMobi Web Developer’s Guide 6
After reading this guide, you should have a firm understanding of the basics of
mobile presentation: what to do and what not to do. This should help you
Part II of this guide will address more advanced topics such as adaptation of
content to suit the capabilities of more advanced devices and provide a better
• It can enable access to information, any time and anywhere there is cell
search for a nearby WiFi hotspot, people can quickly retrieve and
exchange information.
expected that half of the planet’s population will have access to the
2
Informa Telecoms & Media (2007)
DotMobi Web Developer’s Guide 7
steps required for the user to reach useful content, and so makes it
DotMobi
mTLD Mobile Top Level Domain, Limited (usually known as dotMobi) is the
mobile and Internet organizations, .mobi addresses the need for seamless access
DotMobi is the first and only top level domain dedicated to users who access the
Internet through their mobile phones. With four mobile phones purchased for
every one personal computer, there’s a world of people for whom the mobile
phone is the main access point to the Internet. And those users can trust that a
Web site is compatible with their mobile phone when that site’s address ends in
.mobi.
to reach and interact with their customers while mobile. A .mobi address allows
For content providers, it opens a new and more profitable revenue stream,
Conversely, for mobile service providers, the .mobi domain provides them with
the ability to take advantage of profitable data services while ensuring a good
DotMobi Web Developer’s Guide 8
user experience, and in return, gain customer loyalty. This is because the
phone by encouraging site owners to use dotMobi Switch On! TM Guides, based
DotMobi, the company behind the .mobi domain, is backed by 13 of the world’s
leading mobile and Internet players – the same companies who have delivered
ask is, “Why should it be mobile?” Simply having the content and the ability to
mobilize it is not on its own, enough – you should focus on providing content that
is directly useful to a mobile user and takes account of the differences in device
characteristics.
Some recent mobile handsets can render existing PC-focused web sites.
However, the user experience is often sub-optimal – the most relevant content for
the mobile user may be difficult to access. Some particularly rich sites may not
render at all on the mobile and viewing the site may be slow and expensive.
After asking “Why?”, ask “What content should I make mobile?” “What need do I
serve by making my content available to mobile users?” “What value does it add
The key point here is that certain things may not make sense in the mobile
site on a mobile device isn’t a good way to start a mobile project. A sports-based
Web site that provides stories and scores might work well with text-based scores
for mobile devices. However, it’s likely that when presenting the information on a
mobile device you will probably want to change the navigation structure and you
The example emphasizes the need for starting with basic user goals in creating a
successful mobile strategy – take away any content that doesn’t support the basic
user goals and use cases. You should constantly ask, “Why should it be mobile?”
DotMobi Web Developer’s Guide 10
to keep your mobile presence aligned with user goals and to build a compelling
mobile experience.
That said, bear in mind that some users will want to experience the full desktop
version of your site while mobile, and should not be prevented from doing so –
You should start a mobile project by defining the overall goals for the site.
Consider grouping these into the following three categories for easier
• Business: These come from your project’s business goals and should be
clearly defined before you begin. What are your organization’s goals? How
does a mobile presence help your organization achieve its goals? Does it
experience on all mobile devices, or creating a basic web site with free
goals. How does your audience benefit from a mobile presentation? What
tasks will they accomplish with your mobile content? Does the immediacy
of mobile help the user? How will they interact with your content? Context
is big in mobile, so the key is to understand your users’ wants and needs.
Ensure that you value the attention, time and money of your audience, i.e.
try to find and maintain a balance on all three sides: business, user and
technical. If you lean on one side too much or too little, then the other
sides suffer.
User goals usually make a great place to start, and this is especially true when
considering mobile.
User-centered Design
Understanding the needs of users helps humanize the process and keeps your
project in check with their goals. Users know best and will cast their vote by
A user-centered design approach fits especially well with mobile. Start with
context. Think about how and where people will interact with your content or
application. What content would they want to get through a mobile device?
accessing the site from a mobile would probably want a textual menu, location
mobile users often usually require information that they can action - so, as an
example, providing the day’s specialties on the site would be a good feature to
offer – with the phone number on the same page. Technological constraints
DotMobi Web Developer’s Guide 12
mean that you should verify the capabilities of the user's device before offering
Thinking about how someone interacts with a mobile device and the context
around that provides the best first step in creating an effective mobile experience.
strategy. It is important that you understand what your audience is looking for so
you can anticipate how they will want to navigate your site, and so provide them
Analyzing demographic and market data on your target audience helps with
identifying the needs of your mobile user, but nothing works better than engaging
them in conversation. Talk to friends and family on how they would use your
Professional Web developers use techniques such as focus groups to help them.
DotMobi Web Developer’s Guide 13
as possible. Placing the right information in the right place is an important part of
experience.
While building the mobile information architecture, think about users’ “click
long for users to become frustrated with lengthy sequences of retrievals, and give
On the other hand, a user presented with a clear goal and intelligent ways to
reach it, may tolerate latency issues and the time taken to reach the goal. This is
best done by setting user expectations. Every link should use clear labels to
communicate to the user what to expect on the resulting page, thereby lowering
Keep It Simple
The best advice for creating a strong mobile information architecture is to keep it
as simple as possible. The following two approaches work well when structuring
• Limit choices. Take the content that’s relevant to a mobile user and
discard the rest. This results in a simple and focused IA that cuts down
the risk of the user getting lost. This approach works well with small,
focused sites.
plan carefully before taking this approach. A typical Web site has sub-
pages - users follow a link to reach the sub-page. This is drilling down to
Drill-Down Recommendations
as they go deeper into a site. With a Mobile Web site, their tolerance often
stops at about five levels – the fewer levels the better You should adjust
capable devices.
accesskeys, so that the user can use the phone numerical keypad of a mobile device
targeting more capable devices that can display this information better.
• Provide at least one content item with each category page i.e. avoid
empty links: Giving users at least one sample of the content within a
category is a good way to make sure that users get to the right place.
Consider placing a link to the featured content with a one or two sentence
most sought-after content appears first on the list. You improve a user’s
DotMobi Web Developer’s Guide 16
lower listed and newer items won’t perform as well. You can work around
Once you determine your content requirements and define your category structure
and labels, compile them into a simple site map. This gives you a high-level
complete idea of how the real site interaction will work – testing on real mobile
Click Streams
designed click stream is an important concept in mobile More specifically, a Carrier Deck is
used to describe a Web presence
design and development. maintained by a mobile service
provider. When you access the Web
from a mobile device, the first page
you see is often referred to as the
This method is effective in showing what actions users will carrier deck.
likely take to reach their goals and is similar to the model Deck Placement: The term used to
describe where a third-party vendor
used on PC-oriented Web sites when long articles are Web site or application will appear on
the Carrier Deck. Default order of
content on most Carrier Decks is
published. By combining the concepts of a wire-frame and
determined by sales. New items often
have temporary “Top-Deck
a traditional click stream, we can more accurately recreate Placement”
If you plan to have your site accessed through a mobile service provider portal –
often referred to as a carrier deck – then note that creating a click stream is a
They usually want to see an early click stream prior to development and may
click stream or site map when requesting consideration for the provider’s portal
Prototyping
While click streams give you a way to visualize how your mobile information
architecture will work in an ideal world, it doesn’t show what you could do
better. If you plan to test the usability of your information architecture with
potential users (as you always should), creating a prototype is a cheap and easy
method of finding potential and costly problems early on in the design and
development process. There are two main types of prototypes, paper prototypes
Paper Prototype
interaction of your site. You can create a paper prototype in a couple of hours
and present it almost anywhere. It can be tricky to find people to participate, but
them to perform. Start the activity by explaining what goal you want them to
reach. For example, “Find today’s movie times.” Use this time to interject
conceptual asides like, “Is this something you have done, or considered doing on
Keep the tasks simple and avoid confusing them. Most importantly, leave room
in your script to improvise. If they get stuck on a particular screen, draw a new
script on the spot and see if it works better. Don’t rush from participant to
participant. After each study, you gain insight and find answers to some
problems. Keep modifying your script and screens for each participant until it’s
right.
HTML Prototypes
The HTML prototype is another method of prototyping that can take a little more
time to create than paper prototypes, but they can provide greater flexibility in
testing. Create each of the primary screens just as you would a paper prototype,
but instead build them with HTML. This lets you to link each of the screens
You can remotely test a simple HTML prototype through any desktop Web
browser or on the mobile device itself. While this testing method works in an
observed environment like a paper prototype, it’s harder to make changes on the
spot. The real benefit comes from the ability to email the prototype to others
asking them to perform one or two general tasks. The participant provides
in a medium that’s difficult to test. Getting feedback from real people while
developing naturally steers the project toward a much more usable and valuable
experience.
DotMobi Web Developer’s Guide 21
designing for desktop-oriented Web sites, there is nonetheless great scope for
You can create rich mobile experiences but care needs to be taken to match the
design to the capabilities of the requesting device: a site is only as good as the
browser that displays it. Devices and browsers are already very good, and
improving rapidly, but you can still expect to encounter hurdles like slow load
Outside of the Mobile Web we’re lucky to have a manageable number of different
pixels and have a full keyboard and mouse. With the Mobile Web on the other
hand, there is a lot more diversity in the physical attributes of the devices –
screen sizes and keyboard layouts vary hugely across the range of devices
currently in use.
DotMobi Web Developer’s Guide 22
By separating these screens into different classes of devices you can narrow the
number of screen sizes to worry about and so reduce the complexity of the design
hugely.
You should also bear in mind that it’s the screen width more then the screen
length, which defines the usability and attractiveness of the outcome. Images
that look good in a lower-end phone with a low resolution screen may fill only
half or a third of the screen of a high resolution phone, and may not be useful
without zooming.
This comes back to knowing your target audience and the devices they’re likely
to have. Once you know this, you’re better equipped to decide what screen
Part II of this guide will go into a lot more detail on the tools and methods for
When designing for mobile, think about the different classes of devices. The line
between devices is not well defined, making designing for mobile more
challenging. Instead, the boundaries shift constantly. Despite this, some simple
guidelines exist to help you determine what device class to target. The mobile
slider form. They have a 12-key layout Clam shell: a phone design that folds
in half, with the screen on one half
and typically come with voice, messaging and the keypad on the other.
come with built-in digital cameras and media players. Companies typically
2. Smart Phones: Smart phones share the same features as a feature phone
more full featured operating system and companies market them as them
3. PDAs: These devices — evolved from the PDAs of the ‘90s — now often
common with the smart phone but differ in that much of their
phones. They also feature a larger screen that can often switch between
phones aimed at developing markets and are not relevant in the context of
Feature Phones lead the market by a large margin but bear in mind that the
borderline between the Feature Phones and Smart Phones is constantly shifting
towards the Smart Phone category – the newest Feature Phones are often equal
tabbed navigation schemes and menus located on the sides of the main page
content.
DotMobi Web Developer’s Guide 25
These schemes give us useful visual clues about where we’re located within the
site and provide reference points on how to navigate within the site. Obviously,
limited screen size and navigation capability constraints. While it isn’t impossible
to use desktop style navigation scheme like tabs on a mobile device, they
generally do not work as well as they do on the desktop due to the limited device
Primary Navigation
Secondary
Content
Navigation
Footer
The preferred and most common method of creating mobile navigation schemes
is to use a simple vertical list of options, often assigning and listing the
corresponding numbers (0–9) to the accesskeys for keypad navigation. You can
design this list in many ways using stylesheets or images. You should consider
Showing multiple levels of navigation within your list usually doesn’t work well
because it gives users too many options and consumes valuable screen area. A
better way is to show only the options related to the page they’re viewing.
However, you should provide escape points, either as links to the next section, to
the parent section, to the home page or all of the above. These links usually work
best at the bottom of the page and allow the user to move on without scrolling
Not only does the desktop Web rely on navigation schemes we have taken for
granted, but also we also tend to design for it in landscape mode, where the
pages are wider than they are tall. Designing for the mobile requires switching
the thinking to portrait mode where the content is typically taller than it is wide.
Most landscape layouts and navigation schemes – like horizontal tabs and
columns of text – don’t well work on the mobile. Instead, think of the mobile like
a page in a book with a portrait orientation. So use a single column with text
• Mobile Usability: How Nokia Changed the Face of the Mobile Phone, by
technology works. An industry standards body, such as the World Wide Web
“Web standards” can also describe the techniques of applying the language or
stylesheets (CSS).
There have been accepted industry Web standards and best practices for mobile
development in place since the late ‘90s. The currently accepted mobile
However, mobile devices throughout the world vary in how they render content.
This resembles the differences between Netscape and Internet Explorer in the
late ‘90s or even Firefox and Internet Explorer today. However, the mobile device
space is more fragmented: instead of having a few major mobile browsers, there
The good news is that of all the various browsers, many are simply variations of a
previous version. The inconsistency between the browsers is often minimal and
The bad news is that this problem is not likely to disappear any time soon. For as
long as software comes built-in the device from its manufacturer, it’s difficult to
upgrade. This is especially true for lower-end phones that do not normally allow
That said, this situation will improve as time passes, just as it did with desktop
improve their browsers, helping stabilize the situation. Furthermore, there is now
browsers and support for this baseline set of standards is improving all of the
time.
This section of the guide focuses on the most important mobile standards
providers and mass-market mobile phones in North America and Europe retain
WAP 2.0 is the current version of the standard. One of the major goals of WAP
2.0 was to bring mobile devices closer to the desktop by adopting the following
changes:
and HTTP rather than the proprietary protocols used by WAP 1.0.
WML was the core markup language of WAP 1.X. WML is an XML-based markup
language that differs significantly from HTML (the markup language used in the
Web). The term “deck” first applied to WML sites since each interaction or page
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML
1.1//EN""http://www.phone.com/dtd/wml11.dtd" >
<wml>
<card id="main" title="First Card">
<p mode="wrap">This is a sample WML page.</p>
</card>
</wml>
browsers. Since WML is widely supported and is fairly consistent about browser
DotMobi Web Developer’s Guide 32
rendering, it serves this purpose well. The downside is that WML has more
limited design capabilities than XHTML and does not support the richer features
XHTML-MP 1.0 was defined by the OMA and is an extension of the original
Over time, OMA has developed XHTML-MP and now has a proposed 1.2 version
of its specification. Thanks to recent alignment efforts between the W3C and the
OMA, the proposed W3C XHTML Basic 1.1 and XHTML-MP 1.2 are virtually
indistinguishable.
Since both XHTML Basic and XHTML-MP are subsets of XHTML, the transition
XHTML Basic 1.1 is set to become the standard level of support on mobile
XHTML-MP 1.0 browser, and any XHMTL browser (such as a PC browser) will
Wireless CSS
presentation from the markup, just like on the desktop. The OMA-managed
Wireless CSS standard is a subset of CSS and is also part of the WAP 2.0
specification. Note that Wireless CSS is not backwards compatible with WML.
You can add Wireless CSS to your document the same way as you would for a
normal HTML document. Link to an external global stylesheet using the following
line:
<style>
p {
font-size: small;
}
</style>
Wireless CSS supports a lot CSS attributes, but not all of them. Note that more
advanced styling techniques won’t likely work across multiple mobile browsers.
Like XHTML, OMA and W3C are working towards producing a harmonized
mobile version of CSS called CSS-MP. Work on this is still at a preliminary stage
Remember that confusingly, XHTML-MP comes from OMA, and that CSS-MP
and presentation. Controlling every element of the visual presentation using style
sheets frees content from the medium giving you greater flexibility and control.
markup to hold small sliced up images create the desired, and often pixel-
tables simplified the process of changing the design’s look, feel and interface for
In the early days of the Web standards movement, not all Web browsers
supported the extensive use of stylesheets for presentation. In this case, the Web
standards developer semantically coded pages meaning they coded the content
in the same order as it appeared on the screen. The approach lets users with
older browsers that poorly supported CSS to read and use the site.
This merge of techniques has benefited the Mobile Web. Developers produced
content for the desktop screen that could easily be adapted for the mobile screen.
Thanks to the fact that XHTML-Basic is derived from XHTML, phones supporting
XHTML-Basic can often support simple XHTML. In other words, a site coded in
Please note that the one-size-fits-all approach represents the most basic
approach to mobile design. If you have capabilities and tools to develop content
that recognizes the characteristics of the device and serves specially formatted
W3C Initiatives
In spring of 2005, the World Wide Web Consortium (W3C) created the Mobile
Web Initiative (MWI) which consists of several working groups. The group’s goal
Mobile Web.
mobile devices.”
The Device Description Working Group’s goal has a more technical focus “to
enable the development of globally accessible, sustainable data and services that
mobile devices.
DotMobi Web Developer’s Guide 36
The W3C Mobile Web Best Practices Working Group (BPWG) has made a
concerted effort to understand and address the majority of issues that face the
Mobile Web user. The goal of the group is to advocate a variety of coding
service providers.
The W3C Mobile Web Best Practices: Basic Guidelines (MWBP) is the first
deliverable of the working group and echoes the recognized best practices
The recommendations and principles of this guide embrace and extend the W3C
environment in which the Web can be experienced. Many of the practices in the
recommendations. Designing Web sites with the DDC in mind helps ensure
interoperability with devices of this kind. However, only having those devices in
mind might mean that content providers miss the opportunity to provide a better
mobileOK
mobileOK is the second deliverable from the W3C Mobile Web Best Practice
to indicate that the Mobile Web site adheres to the Best Practices
DotMobi Web Developer’s Guide 37
scheme is appropriate for low end devices. MobileOK is a useful tool to help site
builders to check that their work well on low-end devices but developers should
This guide’s recommendations and principles support the W3C Mobile Web Best
Practices and the mobileOK scheme. The dotMobi MobiReady Report validates
and ensures sites are compliant with the mobileOK scheme as well as providing
dotMobi has worked in conjunction with all major mobile service providers,
World Wide Web Consortium (W3C) and the Mobile Web development
DotMobi wants to ensure that all .mobi domains provide the best possible
1.0 or later (e.g. XHTML Basic 1.1), and this must be the default
presentation, unless the site knows that the device supports something
else.
DotMobi Web Developer’s Guide 38
follow W3C Best Practice guidelines, but will not enforce these.
(http://www.wapforum.org/what/WAPWhite_Paper1.pdf)
(http://www.openmobilealliance.org/tech/affiliates/wap/wap-277-
xhtmlmp-20011029-a.pdf)
http://pc.dev.mobi/?q=node/119)
(http://www.w3.org/2005/MWI/BPWG/)
(http://www.w3.org/TR/mobile-bp/)
DotMobi Web Developer’s Guide 39
(http://pc.mtld.mobi/documents/dotmobi_Switch_On_Web_Developer_Gui
de3.html)
• XHTML-MP Specifications
(http://www.openmobilealliance.org/tech/affiliates/wap/wap-277-
xhtmlmp-20011029-a.pdf)
(http://www.openmobilealliance.org/release_program/docs/Browsing/V2_2
-20040609-C/OMA-WAP-WCSS-V1_1-20040609-C.pdf)
modularization-20010410/)
DotMobi Web Developer’s Guide 40
basic HTML site. Since both XHTML Basic and XHTML-MP are similar to
XHTML, it only requires a few changes to format content for the mobile context.
In the next section, we cover the XHTML development recommendations for and
best practices for mobile, but we start with the basics of creating XHTML pages.
If you are familiar with XHTML and the basic principles of Web standards, then
the character encoding and doctype that start off our page.
Character Encoding
Ensuring the use of the correct character encoding and doctype makes sure that
The XML character encoding directive tells the browser how characters on the
page should display. It appears on the first line of each XHTML Basic page as the
Doctype
The document type (doctype) tells the browser how the page needs to be
rendered, including the rules and how strictly to follow these rules.
For those not familiar with XHTML, the first thing to know is that all code should
Here is a basic run down of the rules of well-formed XML as well as the key
• Text should appear within a block level element and not directly in the
There are many online Web tools that you can use to validate your markup
including the MobiReady Report and the W3C Validation service. There are also
browser-based tools such as the HTML Validator Firefox Extension that can be
We can now add our content in the body of our document, but first we need to
add structural elements to contain each logical section, a header, footer and the
With HTML 4, it was common practice to use tables to control the layout of
content. This technique, however, constricts the use of our markup by integrating
presentational layout into our code. While this doesn’t seem like a critical issue,
it becomes a big problem when the page is viewed in multiple mobile browsers.
Instead, use XHTML-friendly <div> elements to logically contain our content for
later styling to control the presentation. Since we usually display text in a single
<body>
<div id="header">
DotMobi Web Developer’s Guide 43
Unlike on the desktop, it usually isn’t a good idea to have a navigation list on
every page. Given the vertical orientation of the mobile page, you should show
only navigation that’s relevant to the page, thereby reducing page weight and
<div id="content">
<ol>
<li><a href="news.html">News</a><li>
<li><a href="products.html">Our Products</a></li>
<li><a href="customers.html">Our Customers</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ol>
</div>
This code links the News item to the “1” key on the mobile keypad and displays
the number 1 by it (if the <li> it is part of is the first in the list, of course).
Obviously, navigation that exceeds the number of keys on the keypad makes it
DotMobi Web Developer’s Guide 44
difficult to provide accesskeys for lists with more than ten items. While not a
requirement for all links, accesskeys are useful for primary navigation.
Unlike on the desktop Web it isn’t the best idea to have a navigation list on every
page. Given the vertical orientation of the mobile page you should only show
navigation relevant to the page, reducing page weight and scrolling. Instead we
<div id="content">
<ol>
<li><a href="news.html" accesskey="1">News</a><li>
<li><a href="products.html" accesskey="2">Our Products</a></li>
<li><a href="customers.html" accesskey="3">Our Customers</a></li>
<li><a href="about.html" accesskey="4">About Us</a></li>
<li><a href="contact.html" accesskey="5">Contact Us</a></li>
</ol>
</div>
For our home page, we can take certain liberties in providing a description for
each link to let users know what to expect in each section. By wrapping the
description into a <span>, we can use CSS to style it differently from the
navigation:
<div id="content">
<ol>
<li>
<a href="news.html">News</a>
<span class="description">Read the latest about our products.</span>
</li>
<li>
<a href="products.html">Our Products</a>
<span class="description">Browse our product descriptions.</span>
</li>
<li>
<a href="customers.html">Our Customers</a>
<span class="description">View our customers.</span>
</li>
<li>
<a href="about.html">About Us</a>
<span class="description">What we do? How can we help
DotMobi Web Developer’s Guide 45
you?</span></li>
<li>
<a href="contact.html">Contact Us</a>
<span class="description">Telephone, email and location
details.</span>
</li>
</ol>
One of the benefits of the Mobile Web is that its users primarily view it on a
phone, allowing the user to quickly and easily make phone calls. It’s an
Like any hyperlink, any text could appear between the <a> element to initiate a
Entering data into a Mobile Web site can be a difficult and time-consuming
process. To avoid wasting the user’s time and causing frustration, use forms
sparingly.
With all the basics covered, the code looks like the following when putting it all
<!--
The page content is sandwiched between the common header and footer. In
this case, our content is a set of links to sections. Because the
content
of this page is static, it is sensible to provide access keys so that
users can access links immediately. Each section is labeled by the key
number corresponding to its access key.
-->
<div id="content">
DotMobi Web Developer’s Guide 47
<ol>
<li>
<a href="news.html" accesskey="1">News</a>
<span class="description">Read the latest news about
<span class="company">Company</span> and our products.</span>
</li>
<li>
<a href="products.html" accesskey="2">Our Products</a>
<span class="description">Browse our product portfolio
and request further information.</span>
</li>
<li>
<a href="customers.html" accesskey="3">Our Customers</a>
<span class="description">How <span class="company">Company</span>
products help our customers succeed.</span>
</li>
<li>
<a href="about.html" accesskey="4">About Us</a>
<span class="description">What do <span class="company">
Company</span> do? How can we help you?</span>
</li>
<li>
<a href="contact.html" accesskey="5">Contact Us</a>
<span class="description">Contact information: telephone, email
and postal details plus a map of our location.</span>
</li>
</ol>
</div>
<!--
The common footer provides the copyright statement for your company and
a
second copy of the navigation bar so that users don't need to scroll
right
back to the top.
-->
<div id="footer">
<p><small>© Company Ltd. All rights reserved.</small></p>
</div>
</body>
</html>
The following is the associated CSS file style.css that provides the styling
body { margin: 0; }
#header { background: #e0ffe0; color: green; border-bottom: solid 1px
green; margin: 0 0 5px 0; padding: 5px; }
#header h1 { margin: 0 0 0 2px; }
#header p { margin: 0 0 0 10px; }
#footer { background: #e0ffe0; color: green; border-top: solid 1px green;
DotMobi Web Developer’s Guide 48
margin: 10px 0 0 0; }
.company { font-weight: bold; }
.small { font-size: small; }
.description { font-size: small; display: block; }
hr { clear: both; border:solid; border-width:1px; border-bottom-
color:#007300; border-top-color:#ffffff; border-left-color:#ffffff;
border-right-color:#ffffff;}
a { text-decoration: none; font-weight: bold; color: green; }
(http://www.w3.org/TR/mobile-bp/)
Practices
The transition from understanding XHTML to developing with XHTML Basic (and
XHTML MP) – the native markup language of the Mobile Web – can be simple in
principle. The real complexity comes with supporting a variety of devices, older
and the best practices collected over the years by the mobile development
community. These practices come from common obstacles that arise when
Together with the mobile development community and the W3C Mobile Web
Best Practices Working Group, dotMobi has compiled Mobile Web development
developers to verify that their Mobile Web site meets these recommendations.
This section addresses each of the individual best practices for Mobile Web
development along with explanation of the problem, the how and the why you
Page Information
The following best practices are related to the overall page information rather
Character Encoding
encodings. XML documents should always have a UTF-8 character set while
Solution: The following line shows how to set encoding correctly in an XML
document:
If you do not specify the correct character encoding for your pages your page may
Browsers assume, by default, that pages delivered with the text/html MIME
type should use ISO-8859-1. Either way you should set the character encoding
explicitly: using the HTTP header and using the XML header.
If you develop Web pages in a Windows environment, note the default character
encoding is often Windows CP 1252 – which is similar to, but not identical to
ISO-8859-1.
DotMobi Web Developer’s Guide 51
Problem: Using the incorrect markup type, specified by the doctype, can cause
Solution: For now, use XHTML MP 1.0 as the default markup for mobile-specific
pages.
Applying the following XHTML MP 1.0 doctype tells mobile browsers how to
browsers render simple XHTML pages. However, for mobile-specific sites, the
as your default markup. If you know that the accessing device supports a wider
MIME Types
Problem: The MIME types sent my HTTP servers provide important information
with a document, it may cause the browser to incorrectly interpret and fail to
Administrators often set up Web servers correctly for more common document
types such as HTML and CSS, but not for XHTML. Verify the addition of the
Page Titles
Problem: Page titles surrounded by the <title> element are an important, but
frequently overlooked page element. Good titles increase the discoverability and
Solution: Add a short descriptive page title for easy identification while keeping
in mind that the mobile device may truncate the title. Most devices use the page
title as a default label for bookmarks, so a title helps the user identify content
within bookmarks.
Discussion: It is common to use only the site name as the title, but it doesn’t
help users as much as it could. A helpful document title consists of the primary
title, optionally followed by your site name as shown in the next example:
Search engines primarily use page titles to identify content. Also, while naming
your pages, think about how users will search for your content on search engines.
Use of Stylesheets
Solution: Using CSS stylesheets helps with consistency and centralizing styles,
stylesheets and images last. This sometimes causes markup to appear briefly
without styles while the external stylesheet loads. Get around this by adding
The recommendation is to always use CSS, separated from your markup. This
allows you to control the page presentation while decreasing the page size and
Objects or Scripts
Problem: Most mobile devices don’t support embedded objects or scripts and it’s
usually not possible for users to install plug-ins to workaround this. Design
content with this in mind. Even where a device does support scripting, steer clear
of using it unless you can’t find another way to reach your objectives. Use of
client-side scripting increases power consumption and drains the battery faster.
so you should ensure that your page works well without it.
device detection strategy, routing devices with better scripting support to pages
Auto Refresh
Problem: A Web page uses auto-refresh, but it incurs extra download times and
data charges.
DotMobi Web Developer’s Guide 54
Solution: Omit creating periodically auto-refreshed pages unless you notify the
Redirects
Problem: Using markup to redirect pages increases the load time that comes
Solution: If you need to use redirects, configure the server to perform redirects
Discussion: Avoid redirects as much as possible since they add both time and
Caching
resources such as images and stylesheets, thereby lowering download times and
costs.
Solution: By specifying cache information on your mobile pages, you lower the
number of times devices download common resources. This especially helps with
resources like a stylesheet or logo. The following example shows how to use a
Discussion: Not all devices support cache control, but caching is especially
important for mobile devices due to the high network latencies typically
Note that it may make sense to wait until you complete development before
adding cache information, otherwise you won’t see development changes when
Structure
Structure
structured content.
Solution: It is good practice for documents to show structure with headings and
to ensure the code elements and the order in which they appear makes sense
semantic coding:
easier to modify content when it splits into several pages. Furthermore, structural
markup potentially facilitates access to the sections of the document that a user
them. For example, they should properly nest based on their level, as shown in
Tables
Problem: On smaller screens, tables often don’t work well or render erratically.
Solution: Unless you know a device supports tables, shun using tables. Smaller
tables with two or three columns work on most devices, but it’s not a
recommended approach.
Nested Tables
Problem: Nested tables (tables within tables), like tables used for layout, don’t
work well in mobile design especially since they render poorly and increase the
page size.
Problem: Layout tables, such as nested tables, don’t work well in mobile design
Solution: The Web design industry considers using tables for layout a bad
practice, particularly for mobile devices. It’s more efficient to do page layouts
with a style-based layout producing a layout that adapts well to the narrow
development more difficult and adapting a page for other mediums almost
impossible.
restrict your ability to adapt for multiple devices and increase page size. Applying
Frames
Problem: Frames don’t work well in mobile design because most devices don’t
support them, and they cause usability problems. Frames are not allowed in
dotMobi sites.
techniques for loading local content. Instead of using a frameset to hold a site
Content
The following best practices are related the main content of a page.
Number of Links
Problem: Too many links on a page makes it difficult for the user to navigate and
read content. Many mobile browsers stop scrolling vertically on pressing the
down key when a link appears in the currently viewed section of the page.
Solution: Try to limit links to 10 links per page and add accesskeys to links
whenever possible, so that user can navigate with the keypad rather than having
Prioritize links by popularity so that frequently accessed links show up at the top.
This creates a better experience by giving users quick access to what they want
and ensures important content appears above the fold. When prioritizing links by
popularity, care should be taken to ensure that new links are highlighted to
The end of each page should give the user some place to go. This could have a
link to the parent category, links to related content, a link to return home or show
the navigation list, anything to help the user move forward instead of scrolling to
thumb, users get frustrated if it takes more than four steps to reach their
destination. Whether or not this is possible depends on the nature of the site
Access Keys
Problem: Navigating a mobile site cam easily turn into a difficult and
cumbersome experience.
Solution: Associating an accesskey attribute with each link gives the user an
easy way to access the link using the device’s keypad. They come in handy when
used consistently across a site letting users jump quickly to their chosen sections
Discussion: You can have more than 10 links per page, but some devices may
not have more than 10 buttons. When possible, create accesskeys for all
navigational links. You can save some accesskeys by not using them for links
appearing within content blocks. It may make sense to use a consistent set of
accesskeys across a site so that, for example, the “0” key always goes back to
the main menu regardless of what page you are currently on.
Problem: It’s difficult for the user to enter content into free text input controls
Solution: While these may be unavoidable in certain cases in forms that need
information from the user, try to use text boxes and text areas as rarely as
possible.
Cut the need for text entry by relying on radio buttons, select boxes and lists of
links.
Problem: It’s possible to limit the type of data that entered into an input field by
defining the input mask or input mode using CSS. This makes it easier for users
mobile device’s keypad according to the input mask value. The following example
The next example limits the input to alpha characters by capitalizing the first
letter.
Images
Image Sizes
Problem: Thanks to the diversity of mobile screen sizes, some text and block
elements automatically wrap to the screen dimensions while large images fall off
the screen.
unless you know that the device supports bigger images. Most mobile device
screens are about 120 pixels wide. Keep images narrower wider than the screen
Discussion: Unless you are using advanced device detection techniques, the
width of an image should stay under 120 pixels. Note that if you simplify the
image creation this way you should avoid use of images that are composed of
Problem: Not specifying the pixel height and width of an image forces the mobile
device to calculate the values, and consequently increases render times and
degrades performance.
DotMobi Web Developer’s Guide 61
Solution: Images such as bitmaps have an intrinsic pixel size. Telling the
browser its size in advance prevents the browser from having to re-render the
page when it receives the image. Letting the server resize the image cuts down
the data transferred and the time it takes for the client to process and scale the
image. If the specified width and height attributes match the intrinsic size, then
Image Maps
Problem: Most mobile devices lack a pointing device like a mouse or rolling ball,
Solution: Omit image maps unless you know the requesting device supports
them.
Alt Text
page.
Solution: Creating pages that are readable without images lets your users browse
your page in text-only mode. As a result, download times and costs go down. If
the user has images turned on, textual descriptions help users assess the page’s
Valid Markup
efficiency.
XHTML-MP won’t render at all, leaving users with an error message in their
browser. Note that different markup types are acceptable if you know that the
Pop-up Windows
Solution: Even when devices support pop-up windows, changing the current
External Resources
Problem: The client device must separately download every external resource
listed in a page (images, stylesheets and other objects). This adds time and cost
to view a page.
Solution: Carefully consider the number of external resources you use, limit them
and keep each resource’s file size as small as possible without sacrificing
stylesheets and images. Depending on network speed, the user may see the
basic markup while external resources download. When the download finishes,
the browser renders the page again with the included elements.
Problem: Large pages take longer to load and increase data charges.
Solution: Keep markup, images, stylesheets and all external resource files small
in size.
Discussion: The rule of thumb is to keep Mobile Web pages under 10Kb in size,
counting both the markup and the included resources. Larger pages sizes of up to
about 25Kb may make sense in certain situations – the key point is to remember
that there is no hard limit here and that different situations may require different
solutions.
8. Mobile Publishing
Publishing is probably the most complicated element of the Mobile Web. People
from the desktop Web development community need to adjust their view when
Luckily, publishing to the Mobile Web does not have to be complicated. There is
plenty of room in-between the simple and the complex for any developer and any
While it is easy to segue into the inner workings of device detection of the
Supporting devices and browsers can be difficult and time consuming Every year,
Since most devices don’t allow over-the-air updates, faulty devices can’t receive
regular upgrades leading companies to pull them from the market and replace
them with a new version. This typically includes a revised version of the browser,
Most mobile service providers recommend supporting devices for two years, a
difficult task.
Supporting devices and browsers is a major concern for many developers from
browsers.
While supporting multiple mobile devices and browsers gets complex, the
situation is not as bad as many believe. This belief comes from looking at the
mobile browser landscape in the same way as desktop Web browser landscape.
• Only Mobile Web sites that are part of a mobile service provider portal
must support all provisioned devices and browsers. Mobile Web sites
ensure that a site will work with most existing browsers but remember
devices may not need to be supported. Drawing a line with device and
browser support is relatively easy because those with older or poor quality
devices typically don’t use the Mobile Web. You can verify this by
reviewing common user agents recorded in your Web server’s access logs.
DotMobi Web Developer’s Guide 66
One way to approach this problem is to focus on five classes of devices that span
devices ensures greater compatibility with more devices and developers should
always endeavor to do this, but supporting five devices disparate devices can do
• A Nokia Series 40
Site Naming
Mobile pages are just Web pages published to any Web server. Nevertheless, it
can be problem a problem getting mobile users enter the URL for your site. The
following options are some of the ways getting users to access a Mobile Web site:
• If you do not have a dotMobi domain, you may try to educate the user to
mobile.example.com.
DotMobi Web Developer’s Guide 67
• Detect the mobile device automatically and redirect the user to a mobile-
friendly location. In this case, the user simply enters domain.com. In this
case ensure that you provide an option for the user to browse the PC
version of the site – many users have advanced mobile devices may
For more information on how to structure your site, when to redirect the user to a
separate mobile-only only site, see Chapter 9. Going further with Adaptation.
dotMobi
The .mobi top-level domain is the ICANN approved top-level domain specifically
for mobile devices giving publishers the option to use an alternate domain for
Much like the sub-domain approach, dotMobi sites sometimes use a separate
server or virtual host, separating desktop sites from mobile sites on the same
server.
If you own a dotMobi domain, you can route all traffic to it using device detection
or server redirects.
Server Directory
You can publish Web sites written in XHTML Basic to most Web servers without
compatible with most content management systems that can publish alternate
templates.
DotMobi Web Developer’s Guide 68
Sub-domains
Since most servers treat sub-domains as separate Web sites with a unique root
directory and server directives, this approach is convenient for your Mobile Web
It’s possible to redirect traffic from a server directory to sub-domains to give the
example.domain.mobi
The Internet Media Type – better known as MIME type – is an Internet standard
protocols. In the context of the Web in particular, it’s used as part of the HTTP
protocol to help the browser understand how to parse and render content that it
receives.
For each request made from a browser to a Web server, HTTP requires that the
Upon receiving this Content-Type header, the browser can decide how to decode
In the mobile context, the server sends MIME types to the mobile browser. Many
Web servers, by default, do not have the correct MIME types defined for mobile
markup standards. It is important set up the Web server to serve the right
At best this may cause the browser to render the page more slowly; at worst your
message.
Site Testing
considering the many devices and the differences in how content renders on the
device. Fortunately, simple testing methods exist for testing your mobile Web
site.
One tip before beginning: Create a simple page on the development server
containing links to the URLs for the sites you plan to test. Bookmark this site on
each device used in the test. This way you avoid having entering URLs into the
Desktop Testing
You can – and it’s recommended – test your markup and stylesheets on a
better CSS support, you can confirm the basic markup and stylesheets. Doing
DotMobi Web Developer’s Guide 70
testing on the desktop comes in handy in finding errors quickly and easily
Opera
The Opera desktop browser has a small screen view that mimics a mobile screen
when loading a mobile stylesheet or condenses the page. Be aware that Opera’s
Frames
Another way to test on the desktop is to create a Web page with an inline
frameset or iframe, specify the dimensions to match your target mobile screen
and add the URL of your mobile site like the following example:
desktop. You can even go as far as to wrap the frame with an image of a phone
Firefox
When using advanced device detection methods, Firefox – with help from the
User Agent Switcher extension – lets you change the User Agent HTTP header
you send to the server. Once you add the data from the supported mobile user
Other helpful all-purpose extensions for Firefox are the Web Developers Toolbar
and Firebug (which provides very useful XHTML and CSS debugging).
DotMobi Web Developer’s Guide 71
Emulator Testing
for a particular device or class of devices. The accuracy of phone and browser
approximations.
While an emulator does not replace testing on an actual device, they are a very
useful tool during development to do quick verification of how your code displays
without loading it on a real mobile browser. Note that regardless of how perfectly
a browser mimics the rendering of page on a real device, they can’t reproduce
the overall experience of using a real device, since factors such as network speed
and latency are involved. For this reason, emulators are a very useful step in any
testing program, but should never be used to replace real device testing.
Device Testing
While getting access to devices, networks and the right data plans is a challenge,
Other methods of testing are very useful, but nothing represents the final
experience better than testing on a real mobile device during the development
process, since this best recreates how the user will interact with your site.
If you have only one device, borrow phones from friends and family. Talk to
vendors that may let you rent phones or use their device lab. If you don’t have
access to a vendor in your area, try going to a mobile service provider store and
Prepaid SIM cards from multiple mobile service provider networks can be a
developer’s best friend. Switching prepaid SIMs allows you to test on multiple
Remote Access
Remote access services let you control an actual device remotely through your
application taps into the actual device, which you rent through the company’s
software. It supports most of the devices sold in North America and Europe.
Remote access provides a compelling method for testing and has the added
characteristics of the actual device. Although it doesn’t replace the tactile lessons
learned from using the real device, it’s a solution for small publishers with limited
resources. It deals with the problem of testing on many devices some of which
Usability Testing
The recommended approach of testing Web sites with users, offers valuable
insight. Testing is a process that should occur throughout the design and
readability and usability of the site with actual users always creates a better site.
This is the perfect time to quote Jared Spool’s golden rule of usability testing,
• DeviceAnywhere.com (http://www.deviceanywhere.com/)
(http://chrispederick.com/work/useragentswitcher/)
(http://chrispederick.com/work/webdeveloper)
• Firebug (http://www.getfirebug.com)
(http://www.forum.nokia.com/info/sw.nokia.com/id/db2c69a2-4066-46ff-
81c4-caac8872a7c5/NMB40_install.zip.html)
(http://developer.openwave.com/dvl/member/downloadManager.htm?softw
areId=23)
(http://www.opera.com/products/mobile/operamini/demo.dml)
compelling experience across device types requires thought and careful planning.
The opportunity: for content providers to stand out from those who don’t, by
demographic.
Most of this document focuses on getting the basic things right. This means that
featured devices. In doing this, dotMobi isn’t implying that it encourages what is
A minimal approach has its place when the service targets users who have only
basic devices or where the content is naturally simply structured and navigated.
However, more and more users are adopting devices that come with advanced
experiences. Thus, more manufacturers and software vendors in the mobile space
with the best possible experience when using your service. In this chapter, we
circumstances of use.
DotMobi Web Developer’s Guide 75
User Choice
one for mobile users is not the right approach. This not only refers to the different
capabilities of the users’ devices, but also to the users’ usually different needs
while they’re mobile and making it as easy as possible for them to reach the
needed content. While this is an important rule of thumb, taking advanced steps
Crucially, when we say “usually different,” there are nonetheless some cases
where some users may have particular reasons for accessing content usually
For example, lengthy research reports are, for most people, hard to read on a
mobile device. When planning your site, you would not make access to such
reports a priority. However, some users, because they need the information and
do not have access to a more appropriate device may wish to access the report
anyway. Some users in various demographics may not have access to a desktop
experience at all.
For these and other reasons, devices coming into the market today anticipate
that users, for whatever reason, may wish to access ‘the desktop experience’
while mobile.
It remains true that typical mobile devices cannot present a full desktop
experience, as the size of the screen and more importantly, the lack of a full
DotMobi Web Developer’s Guide 76
keyboard and pointing device remain obstacles to text input and typical desktop
navigation.
your mobile experience, you do not prevent them from accessing aspects of your
While you should anticipate users’ needs and provide them with what you think
assumptions.
Include a link to the mobile experience on the desktop experience and include a
What Is Adaptation?
In earlier chapters we mention that the mobile space has a range of device types
and content often renders better when tailored to specific device characteristics
or features. Adaptation is about exploiting those features where they exist, while
Adaptation can occur at the server or at the client side (the device). It’s also
possible for adaptation to take place in the network, and operators frequently do
some adaptation between your Web site and the device. However, that form of
Client side adaptation usually relies on using the media selectors associated with
CSS. Stylesheets can provide a different experience for the same page on mobile
unnecessarily taking time and cost the user money with content that’s ends up
To include different mobile and desktop stylesheets in your document, add link
Alternatively, screen and handheld styles can appear in the same style sheet,
For example, if you wanted to suppress the display of an image in the mobile
Note that most browsers will still download the image, and users will suffer the
delay and cost of doing this. So client side adaptation with CSS is mainly useful
Scripting is another technique for client side adaptation. In the desktop world
end devices often include no or limited support for scripts. But for high end
technique.
Server side adaptation comes in various forms. At its simplest, it relates to using
scripting to vary small parts of the page delivery. One example is changing the
not typical to use the content type text/html when delivering to mobile
devices. On the other hand, when delivering such pages to some versions of
Internet Explorer on the desktop, it can be more effective to use that content
type. In this example, the adaptation would consist of a test to see which User
Agent (browser) accesses the page and deliver the chosen header based on
<?php
$msie = strpos($_SERVER[“HTTP_USER_AGENT”],’MSIE’) > 0;
if (!$msie) {
header(“Content-Type:
application/xhtml+xml;
charset=UTF-8”);}
else {
header(“Content-Type: text/html;
charset=UTF-8”);}
?>
Other examples of varying the content to better suit device characteristics include
presenting an appropriately sized image for the device accessing the page. A
good general guidance for low-end devices is to limit images to 120px width.
DotMobi Web Developer’s Guide 79
Those with high-end devices will have a much better experience if the image fits
Because it wastes bandwidth to transfer images that are bigger than the screen
can handle, it’s good practice to resize images at the server prior to transmission.
biggest size that will fit; or dynamically resize the image at the point of delivery.
Both approaches have advantages: The former is better when the image must
preserve specific details (e.g. the ball in a sports photo). The advantage of
To be able to resize images and carry out other kinds of adaptation requires that
Most devices (desktop and mobile) send information about the content formats
and character encodings they support, but they usually don’t provide enough
details for a particular application. Some, but not many, devices present some
impractical for devices to send all the information that is needed for adaptation in
their headers.
Repository. Currently, the standards world is doing a lot of work on this subject.
DotMobi Web Developer’s Guide 80
The W3C and OMA are working together to create a standard framework for
In the meantime, other solutions exist for finding out device characteristics.
One of the better known is WURFL. This open source project maintains and
which help you access this information from server side scripting.
header in the HTTP request containing the URL of a file with information about
the requesting device. If it hasn’t got the file already, the server can find this URL
Mobile Wizards, for example, has collected thousands of UAProfiles and offers
Other companies like Volantis, MobileAware, SevenVal, Drutt and Argogroup offer
Adaptation Strategies
Many adaptation strategies exist, but the one you choose depends on the nature
• Redirection
• Unified
Sites with simple navigational structures can be designed so that they render well
on both mobile and desktop devices. In the right circumstances, using a simple
direct approach provides the most compelling experience across device types.
Minor Adaptation
An embellishment of the One Size Fits All approach, detecting device capabilities
quality images and to include extra features for devices that you know support
them.
Redirection
Sites that are more complex are harder to build in a way that makes that every
page works well on different device types. This is especially so when the desktop
with mobile user needs in mind can prioritize different aspects of the site and its
content than the desktop experience and so make it easier for mobile users to
One solution to this problem is to build a separate mobile site, which could
features. In essence, this approach means that when devices access the home
To do this, the server reviews the User Agent HTTP header and compares the
string with a list (such as the one provided by WURFL). There are other clues in
the HTTP headers that help you determine if it’s a mobile device. Such clues
include the presence of a UAPROF, or the device reporting that it supports WAP
content types, but beware they’re not 100% accurate. Note that a dotMobi site
should default to the mobile version of the page if the device is not recognized.
the server sends an HTTP 301 or 302 response containing the URL of the right
The major drawback of this approach is that it separates the mobile content into
an area of its own, making it hard to share bookmarks between mobile and
desktop devices. It also makes it hard for mobile users to reach the desktop
Another problem is that some more fully featured devices and some versions of
Opera Mini (an adaptation solution) try to emulate desktop user agents in order
not to route to the mobile experience, which can make it hard for mobile users to
should link to the other experience to allow users to choose an alternative, and
provide a backup in case device detection has incorrectly determined the device
type.
Unified
approach by overlaying the URLs that apply to the various experiences onto each
other. This way, bookmarks can be shared between the desktop and mobile.
Pages that don’t apply to one experience can redirect to pages that do apply.
This approach needs more planning and expertise than the others do, but it
ultimately leads to more satisfactory user experiences and repeat visits to your
site.
approach.
Remember
Your assumptions about mobile user context (what they may need or the way
they wish to experience it) should guide the design of the default mobile
those assumptions, and allow them to choose a different experience. Their device
may have been specifically designed to display desktop Web pages, so allow
• WURFL (http://wurfl.sourceforge.net)
based design without tables for layout) adapt to mobile devices much more easily
than those that are not. Lists placed at the top for navigation, header elements
properly providing context to the content and non-use of tables make it possible
for the mobile user to read and use the site, often with few changes to code.
The reality is that it can take as little as adding only one line of code on desktop
Web page to make it format in a mobile friendly way. Just apply a handheld
media type for displaying the mobile stylesheet to the well-formed XHTML
markup and the site turns into a site for mobile browsers.
The one line of code that often appears in XHTML documents is the following:
This loads an external file called “mainstyles.css” containing the site’s styles and
device type. To specify that only desktop Web browsers should use this
Since you’re adding several stylesheets to a document, for clarity, name each
stylesheet after the medium it’s intended for. Start by renaming “mainstyles.css”
Now add the mobile stylesheet, using the “handheld” media attribute:
When specifying different media types as shown in the next example, the
browser conditionally loads the stylesheet designed for its medium. Desktop Web
browsers, for example, use the screen stylesheet. When the user prints the page,
however, the browser switches to the print stylesheet. The real magic happens
when you load the same page on a mobile device. Recent Web browsers load the
handheld stylesheet, styling the content specifically for the small screen.
Using only one line of code, you gain the ability to transform your markup for
mobile devices. (Of course, you still have the task of creating the mobile
stylesheet.)
Warning
This technique can only do so much. It can’t handle complex design using just
CSS and it can’t remove large images using advanced techniques like image
replacement.
File sizes of pages designed for bigger screens are significantly larger, so CSS
needs to hide extraneous elements like headers and sidebars. While this
improves the content’s readability, the user’s device still downloads the hidden
content. The user pays for every kilobyte including the hidden content’s bits.
DotMobi Web Developer’s Guide 86
More importantly, this technique doesn’t affect the mobile context in terms of
Nonetheless, this provides an acceptable solution for those with well-coded Web
sites who simply want to publish simple content and have it display well on
mobile devices.
Part II of this guide will address more sophisticated method of publishing content
device.
DotMobi Web Developer’s Guide 87
Glossary
accesskey
Web page via the keyboard. In most Web browsers, the user does this by
pressing ALT (PC) or CTRL (Mac) followed by the appropriate character on the
Term regularly used in the mobile industry to describe the total revenue earned
BREW®
the richest mobile user interface that is widely available. All applications
designed for the BREW® platform must pass National Software Testing Labs in
First-tier carrier Verizon utilizes the BREW® platform in all their handsets.
Carrier
cHTML
DotMobi Web Developer’s Guide 88
in Japan and other countries. cHTML was the primary markup language of the i-
Mode service
Clickstream
Used to refer to the series of clicks, or path, the user takes to reach a destination
server logs, but also can be used in early planning, as in “creating the optimal
clickstream.”
Carrier Deck
Refers to the Web presence maintained by each carrier. When you access the
Internet from a mobile device, the first page you see is often referred to as the
carrier deck, but will also be used to describe all online carrier services that a
Deck Placement
The term used to describe where a third-party vendor WAP site, or application
will appear on the Carrier Deck. Default order on content on most Carrier Decks
The Catch-22 is due to the constrained screen size, the items that show at the
top tend to have the highest sales. The items at the bottom see very little user
attention.
Device Manufacturer
The term used to describe the manufacturers that make mobile devices, such as
i-Mode
i-Mode is the name given to NTT DoCoMo’s Mobile Web service. This service
was originally offered in Japan only but has now spread to several other
countries.
discipline has its roots in Library Sciences, but has evolved to include many other
requirement.
Java.
Paper Prototype
user asking them to perform a series of tasks. The facilitator acts as the
mobile interfaces.
Premium SMS
via SMS
the message. In many countries around the world there is a controlled system of
numbering so that users can be aware of the cost of PSMS messages before they
send them e.g. 7XXXX might indicated a high cost message, 1XXXX may be the
minimum band.
A format widely used in the weblog space for syndication of content. RSS has
several types of formats, RSS 1.0, RSS 2.0 and all of them are basic XML
documents.
RSS strips presentation from content allowing publishers to reformat content for
other purposes. Generally used for newsreaders or RSS aggregators, but can also
Broadcast messaging system that allows for subscriber to subscriber text based
Subscribers
term to use when referring to users in any communication that could be seen by
carriers.
Walled Garden
This is a term used to describe a service (typically a Web portal) that users are
financial incentives.
DotMobi Web Developer’s Guide 91
software, and tools) to lead the Web to its full potential. W3C is a forum for
XHTML is a markup language that has the same depth of expression as HTML,
SGML.