Overrule the Mendix device type recognition mechanism

There are already phablets on the market and the hybrid tablets (laptop replacements) are coming up. Some users prefer the tablet interface where other users prefer the desktop interface on their tablet. Similarly users with large screen phones could prefer the tablet interface. We would like the user to able to choose their interface. Is there a way to overrule the automatic device type recognition mechanism of Mendix?
2 answers

This should be possible. I have just tested it on my own local machine and it should work. You can append a get parameter to the end of the url to tell the mendix platform that you want the desktop, tablet or phone.

The get parameter is ?profile=phone, ?profile=desktop and profile=tablet.

If you create a piece of html and javascript you should be able to allow the user to select from a dropdown their view and open up the application on a said device.

The code could look something like:

<script type="text/javascript">
    function selectDevice(obj){
        var urlString = ".";
        var selectedDevice = obj.options[obj.selectedIndex];
        if (selectedDevice.value != "nothing"){
                window.location = urlString + '?profile='+selectedDevice.value;

    <select onchange="selectDevice(this)">
    <option value="nothing">Select device</option>
    <option value="desktop">Desktop</option>
     <option value="tablet">Tablet</option>
    <option value="phone">Phone</option>

I just test this. If you put the javascript in the html file. Then put the html in a html snippet in the modeller it should work.



Yes, this is very easy, just put ?profile=phone/tablet/desktop behind your URL.

Like this: http://localhost:8080/?profile=phone