Check for tablet vs handheld device?

Anyone know of a good way to check what kind of device the user has? I know about the system.getInfo() call but it seems possible only to detect model and OS.

I need to hide a certain section of the app if the user has an Android tablet or iPad/iPad2. [import]uid: 52127 topic_id: 20932 reply_id: 320932[/import]

I was also looking for a way to do this. So far the only thing I could come up with is to check for common tablet resolutions (800X600 , 1024X768, etc)and flag it as tablet device if the screen resolution is equal to any of them.

To get the physical screen dimension, regardless if dynamic scaling is in use, you can use this code:

local width = display.contentWidth - display.screenOriginX\*2;  
local height = display.contentHeight - display.screenOriginY\*2;  
local realWidth = m.round(width / display.contentScaleX);  
local realHeight = m.round(height / display.contentScaleY);  

then you can check for common tablet screen resolutions:

local isTablet = false if (realWidth == 800 and realHeight == 600) or (realWidth == 600 and realHeight == 800) or (realWidth == 1024 and realHeight == 768) or (realWidth == 768 and realHeight == 1024) then isTablet = true; end [import]uid: 33608 topic_id: 20932 reply_id: 82619[/import]

Hi all,

Anybody doesn’t have another solution? Because with the evolution of tablets and smartphones, the display resolution is more and more raised and this solution reaches fast its limits. ( cf Retina Display and Galaxy Note)

Thanks ! [import]uid: 132686 topic_id: 20932 reply_id: 115997[/import]