Now teaching Mobile Web Development at Portland Community College

Register now for Mobile Web Development for Summer 2010. Class meets at 5:30pm - 9:30pm on Wednesday evenings July 14 - August 18, 2010 in Portland, Oregon.

See the Mobile Web Development curriculum or contact me for details.

how to develop standards-compliant and usable mobile web applications

Tag: Mobile Web

No Gravatar

I am seeking interviews with real-world Mobile Web developers for a series of articles about what it really takes to build and deploy a high-traffic, content adaptive and standards-compliant Mobile Web site. Volunteers are encouraged!

Are you an in-the-trenches Mobile Web developer? Have you successfully navigated technology and deployment challenges to release a Mobile Web site? Do you have advice and strategies that you’d like to share with the mobile developer community? Please contact me and include a link to the mobile site.

The articles will be posted here and possibly re-published at other technical blogs and magazines.

Bookmark and Share
VN:F [1.5.2_773]
Rating: 0.0/5 (0 votes cast)
No Gravatar

Mobile MIME types identify the format of mobile web content: textual mobile markup documents, binary viewable and playable content like ringtones, wallpaper and videos and binary executable mobile applications intended for mobile devices.



Common Mobile MIME Types

Here are the most common mobile MIME types:

MIME Type(s) File Extension(s) File Contents Common Uses
application/vnd.wap.xhtml+xml
application/xhtml+xml
xhtml XHTML-MP markup Mobile web pages
text/html html HTML Mobile web pages for smartphones
text/css css CSS1, CSS2 and Wireless CSS Cascading style sheets for mobile web documents
text/vnd.wap.wml wml WML markup Lightweight mobile web pages for older or low-end mobile devices
image/vnd.wap.wbmp wbmp Wireless Bitmap Image Black-and-white image format used for older or low-end mobile devices that support only WML in the microbrowser.
text/vnd.wap.wmlscript wmls WML Script Scripting language used with WML
text/vnd.sun.j2me.app-descriptor jad Java Application Descriptor Metadata about a Java ME application for mobile devices. Contains URI to a JAR file that is the mobile application binary.
application/java-archive Binary Java Archive Archive of compiled binary Java class files. Used as packaging format for Java ME mobile applications.
audio/x-midi mid MIDI Audio File MIDI ringtones
audio/vnd.qcelp qcp QCELP Audio file mobile audio
video/3gpp 3gp 3GP Video File 3GP encoding for mobile video files
video/mp4 mp4 MPEG4 Video File MPEG4 encoding for mobile video files
x-nokia-widget wgz Nokia Widget Archive Home screen widget for Nokia mobile phones
application/vnd.wap.mms-message mms Binary MMS in MMS Encapsulation Protocol format Viewing and sending MMS messages
application/vnd.symbian.install sis Symbian installer Older file format for Symbian application installers
x-epoc/x-sisx-app sisx Symbian installer Newer file format for Symbian application installers



How Mobile MIME Types are Used in HTTP

MIME types are used in several ways during a HTTP transaction between a mobile web browser and web server:

Mobile Web Browser: The mobile web browser sends a list of supported MIME types as the value of the Accept HTTP request header. The Accept request header value advertises the mobile content types supported on the device. Web servers optimized for delivering mobile content use the header’s value (and also a device database) to determine the best content to send in the HTTP response.

Web Server: The MIME type associated with a web document is used as the value of the Content-Type HTTP response header. The web server is configured to associate file extensions of mobile content with mobile MIME types. (Web servers generally do not come pre-configured to support mobile MIME types. The webmaster must manually add the MIME types.) When the web server sends a file to a mobile browser and uses the correct mobile MIME type, the mobile browser client knows how to interpret the file: as a web page, mobile application, wallpaper, ringtone, video, etc.

Web Server Template Languages: The MIME type associated with for a document can be manually overridden using a server-side template language like PHP. Here is a PHP example that uses the built-in header function to override the MIME type for a HTTP response:


<?php
header('Content-Type: text/vnd.wap.wml');
?>

It is important to correctly configure mobile MIME types on the web server because the mobile browser uses the MIME type (value of Content-Type HTTP response header) to determine whether the web file is viewed in the browser or by launching phone UI (to set a GIF as wallpaper, etc.) or by launching a native application (playing a video in the video player, etc).

Read more about web server configuration for details about adding MIME types into Apache and IIS web servers.

Bookmark and Share
VN:F [1.5.2_773]
Rating: 4.5/5 (2 votes cast)
No Gravatar

In HTML, there is a very simple way to advertise a relationship between a desktop web page (or site) and the equivalent page (or site) on the mobile web. Very few desktop web sites implement this practice today. I have no idea why not, because the change is trivial and the benefits are broad.

Use link relationships to express that a particular web page is the mobile equivalent of a desktop web page. Link relationships can also be used to express that a mobile web site is the mobile equivalent of a desktop web site.

Link to Mobile Version using HTML Link Tag

Here is an example HTML link tag embedded in the header of a desktop web page to declare a relationship with a mobile web page:


<link rel="alternate" media="handheld" href="http://m.example.com" />

  • The href expresses a page-to-page relationship when its target is the exact equivalent mobile web page, i.e. a mobilized version of a news article.
  • The href expresses a site-to-site relationship when its target is the entry point of the related mobile web site, as in the sample.

An added benefit of using link relationships for mobile web discovery is improved mobile SEO. Desktop web crawlers look for HTML link tags to define page relationships. The crawler obtains the mobile web URL from the href attribute and knows from the media attribute that the content is mobile-friendly.



There are two other easy ways to increase mobile web discovery. These approaches are effective for mobile site discovery but don’t express direct relationships between a desktop web document and its counterpart mobile web document.

List Mobile Web URLs in a Google Mobile Sitemap

Use a Google Mobile Sitemap. A Google Mobile Sitemap is a sitemap file containing only mobile web URLs. The sitemap uses an additional XML namespace and a new tag to declare a URL as mobile content. Advertise your mobile sitemap in /robots.txt or submit it directly to search engines using webmaster portals.

Here is an example Google Mobile Sitemap:


<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0">
<url>
<loc>http://mobile.example.com/article100.html</loc>
<mobile:mobile/>
</url>
</urlset>



Specify Mobile and Desktop Entry Points in Meta.txt

Use a /meta.txt file in the root directory to define PC and mobile entry points (and other metadata) for the website.

Here is an example of a meta.txt file that would be found at http://example.com/meta.txt:

name:example.com
description: example.com is a widely used example website
keywords: example, demo, demonstration
pc: http://www.example.com
mobile: http://m.example.com
rss:http://rss.example.com/rss/topstories.xml
rss:http://rss.example.com/rss/politics.xml
podcast: http://rss.example.com/podcasting/news.xml
video: http://rss.example.com/rss/tutorial.xml
longitude:12.3456789
latitude:98.7654321
region:MM

Bookmark and Share
VN:F [1.5.2_773]
Rating: 5.0/5 (2 votes cast)
No Gravatar

Portland Code Camp is this Saturday, May 30th at Reed College. It’s a free, one-day community-driven conference for developers working on all platforms, programming languages and disciplines. I am attending Portland Code Camp and looking forward to participating in the mobile sessions!

The tentative Portland Code Camp schedule (pdf) was just released. There are a wide variety of sessions about mobile, desktop and server development.

I am presenting two sessions at Code Camp. Here are the slides from each presentation.

Smartphone Behavior on a Featurephone Budget using Java ME. 10:45am – 12pm in Vollum 120. We explore using the Java ME API to produce application features generally seen only on smartphones. It’s a preview of my JavaOne BoF to be presented the following week.

A Standards-Based Approach to Mobile Web Development. 3pm – 4:15pm in Psych 201. We discuss a standards-based approach to mobile web development that produces a usable, adaptive and discoverable mobile web experience for featurephones and smartphones.

Bookmark and Share
VN:F [1.5.2_773]
Rating: 0.0/5 (0 votes cast)