On the server-side, mobile applications are built using the
API without the need to know what device the application will run on. Once a request has been processed and the application has defined what data and UI elements to send back to the mobile user, that responsed is run against the UserAgentMapping.xml to manage what resources to use to render that content.
Dissecting a UserAgentMapping Node
The "match" attribute defines a RegEx string to match on the UserAgent of the request.
The "type" attribute indicates what type of navigation to use.
<UserAgent match="iPhone|iPod|webOS|Series60" type="ajax">
Any number of meta tags can be added to the rendered html
<MetaTags>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
</MetaTags>
The Script tag contains all the javascript files to be included in the <head>.
<Script>
<File name="jquery" src="js/jquery-1.2.6.min.js"/>
<File name="jquery.object2xml" src="js/Object2XML.js"/>
<File name="interfacesupport" src="js/InterfaceSupport.js"/>
</Script>
The CSS tag contains all the CSS files to inlcude in the <head>
<CSS>
<File name="CoreCSS" href="inc/mCore.2.b.css"/>
<File name="StyleCSS" href="inc/mStyle.2.b.css"/>
</CSS>
The ListStylePlatform refers to what html structures should be used as defined in ListStyles.xml
<ListStylePlatform ID="A"/>
</UserAgent>
You will also notice that each resource tag has a "name" attribute. If you provide a UserAgentMapping file with your custom application, you can specify resources using these built-in names to overwrite the default or specify new names for new resources. A UserAgentMapping file that is included with an application gets merged with the default and therefor does not have to be complete. You only have to include the changes you want to make to the default UserAgentMapping.xml.