Is Tablet action performance issue.

Is Tablet action performance issue.

  

Hi,

Now I am developing one universal app which will have the same designs and functionalities in both mobile and tab. In order to identify the device, I am using "IsTablet" client action from mobile patterns, if it returns "True" ,i will redirect the app into Tablet HomeScreen, otherwise it will be redirected to mobile screens. In this Scenario, I am facing one issue:

1. Whenever i enter into the application with the Samsung Tab 3 device, IsTablet client action is not recognizing the device as tab.

2.I have been redirected to the mobile screens, which is not suitable for the tab view.

May i have any help to solve this issue.

Thanks,

Vignesh Balasubramanian


Hello Vignesh,


The GetDeviceType action does this:


var classList = document.body.classList;

if(classList.contains("phone")) {
    $parameters.Device = "phone";
} else if(classList.contains("tablet")) {
    $parameters.Device = "tablet";
}


The IsTablet action just compares the output of the GetDeviceType against a "tablet".


For some reason, the Samsung Tab 3 is having the class "phone" on the classList while it should have the tablet instead. On Chrome, when passing the screen specs of the Samsung Tab 3, I get this as a result:


document.body.classList
DOMTokenList(2) ["phone", "portrait", value: "phone portrait"]


So, either Silk UI is not detecting the user-agent string correctly - if applicable - or the tablet resolution is easily misunderstood as a phone - therefore having the phone classes.


Cheers!

Hi Armando,

Is there any other solution available with outsystems to sort out this problem?

Thanks,

Vignesh Balasubramanian

Hi Vignesh,

Your issue can be resolved.

You can use javascript to check the screen resolution and redirect on that basis. Kind of a manual check of the screen size.

There are these windows properties available to check the size of the screen. 

  • screen.width
  • screen.height


Regards,

Waseema.

Hello Waseema,


Do you have a sample of that working? I'm saying this because, for instance, iPhone 8 has a variable resolution between 1334x750 (4.7'') and 1920x1080 (5.5''). The Samsung Tab 3 has a resolution of 1024x600.


Using the screen.width and screen.height, wouldn't that "assume" that the 5.5'' iPhone 8 would be... a tablet?


Cheers!

Hi Armando,

Kindly, suggest me one nice solution to sort out this problem. I have tried with the screen resolution JavaScript, but I removed the script according to your above mentioned reply.

Thanks,

Vignesh Balasubramanian

Hello Vignesh,


On the WebPatterns eSpace, Site Properties tab, you'll have the following entries:


Regex_PhoneText(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino
Regex_TabletTextipad|android|sch-i800|playbook|tablet|kindle|gt-p1000|sgh-t849|shw-m180s|a510|a511|a100|dell streak|silk


You'll need to understand what is the user-agent that your Samsung Tab 3 is returning to the server and change the Regex_Tablet entry accordingly.


Cheers!

Hello Armando,

On the WebPatterns eSpace the above mentioned things are available but the case is, my application is for mobile, not for web. Can you explain me in brief manner that how it would be useful for my problem or kindly, suggest me any other solution.

(Note: I facing a problem with IsTablet Action which available in MobilePatterns)

Thanks,

Vignesh Balasubramanian

Hello Vignesh,


This solution was provided by OutSystems themselves in a support case I had access to.


Cheers