Hi there,
I’d like to have two different UIs for mobile browsers and desktop browsers. I read that this is possible specifying in web.xml a fallback application for non webkit browsers. I was not able to make the fallback application run when the browser is not webkit based. Please help me.
The fallback application is only served for non-webkit users. So in you touch kit apps onBrowserDetailsReady method you should still check whether your device really is a touch device or not. If not, you can serve the desktop app or redirect your users to an address that always serves the desktop version. I’d probably do the latter. It paves way for possibility to use the desktop version with mobile version too if necessary (e.g. if you have touch optimized mobile version with only main feature and full featured desktop version, you might in some cases want to use the desktop version with your smartphone or tablet).
Is it not possible to auto redirect to the correct web application based on browser or screen type? If the browser (or screen) is considered desktop-type then display desktop version, else display mobile version…
In onBrowserDetailsReady() function you have full details about browser like if it supports touch events. At that point you have the most details to do your decisions. See e.g. our
demo app code here . Instead of showing notification you can e.g. redirect to a different address like this:
The decision whether the fallback application is chosen directly is done by the TouchKit servlet. If you know what version to show based solely on the request details you can also extend a special version of the servlet and override this method:
/**
* Method detects whether the main application is supported by the TouchKit
* application. It controls whether an optional fallback application should
* be served for the end user. By default the method just ensures that the
* browser is webkit based.
*
* @param request
* @return true if the normal application should be served
*/
protected boolean isSupportedBrowser(HttpServletRequest request) {
BTW. If you want priority help for your team in cases like these, I’d suggest to use our Pro Support service. You’ll often get answers much quicker via that service.