Mobile XPage launch

A specified XPage can be launched from a mobile device through a work-around.

The work-around is to create an empty XPage and specify it as the launch page in Application Properties. Then create an afterPageLoad event handler that redirects to a mobile page or a non-mobile page depending on context. Use the following code as a model:
<xp:this.afterPageLoad>
<![CDATA[#{javascript:
	var uAgent = context.getUserAgent().getUserAgent();
	if ((uAgent.match("iPhone") !== null || 
		param.platfrom=="iphone") || 
		(uAgent.match("Android") !== null || 
		param.platfrom=="android") || 
		uAgent.match("iPad") !== null)
		{
			context.redirectToPage("/m_Application.xsp", true);
		}
		else
		{
			context.redirectToPage("/allDocuments.xsp", true);
		}
}]]>
</xp:this.afterPageLoad>