I have built a mobile app and the generated application is not detecting if the device is a tablet or a phone, thus throwing the UI out of whack. 

For east of testing, I have been using Android Emulator to emulate different devices to install the app on. It does detect the device if I'm using a phone emulation, but if I use a tablet, it won't detect it. 

On a side note, when I do use the phone emulation, it thinks its a tablet if I have it in landscape. 

Does the mobile platform use the device itself or does it rely on resolution to determine phone versus tablet? 

Hello Jason Matti,

Can you please check in Client action there is GetDeviceType() available.

Suhas Jamdade wrote:

Hello Jason Matti,

Can you please check in Client action there is GetDeviceType() available.

I actually have tried that. It seems to be returning nothing. 


You can show us how are you using this component?

You can make a client action and put on your screen, it will return in the message if it is phone or tablet. It should work.

I actually have a client action that populates an expression object:

I should mention, the client action above I have formatted as <DeciveType/DeviceOrientaion>

On my emulated android phone I get this:

but on the tablet, I get this:


Jason Matti wrote:

I should mention, the client action above I have formatted as <DeciveType/DeviceOrientaion>

On my emulated android phone I get this:

but on the tablet, I get this:


Is there any thoughts on this?


Hi Jason,

I hope this message finds you well.

Could you share some details on what type of phone are you emulating?

Thanks in advance,

Carlos

Hi!

This might be related to the tablet size. If it's bigger than 1024px, it is currently not detected as tablet.

This is already identified and will be improved in the product. Meanwhile, you can set the device using the JS API:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/JavaScript_API/View


Hope this helps :)