Go to:
http://www.dokuwiki.org/devel:action_plugins
Adopt Samuele Tognini's action plugin, give it a name of your own. Replace TPL_METAHEADER_OUTPUT with DOKUWIKI_STARTED in
function register(&$controller) {
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this,
'_hookjs');
}
You might also want to change _hookjs to some more appropriate name, like switch_template(). Then in that function write your code, beginning with dominik's reference to clientsmobile to test for a mobile app. If it is, set $conf['template'] to your mobile template. To access $conf you have to declare it global:
global $conf;
if(clientsmobile()) {
$conf['template'] = 'my_mobile_template';
return;
}
If not mobile, then inspect HTTP_USER_AGENT for your other platforms and give them the same treatment.