[Resolved] Tablet or smartphone ?

Hi everyone,

I’m working in my first game with Corona SDK and I have a problem since few days :

I use a stick to control the player but this stick has to be in the center of the screen if player plays on SmartPhone and it has to be in the left if he plays on Tablet.

In a first time I use this solution :
http://developer.coronalabs.com/forum/2012/01/25/check-tablet-vs-handheld-device

But when I tried on differents phone (Galaxy Note, Sony Xperia S, etc), some was detected as tablet. For example, Xperia’s resolution is 780*1024.

In a second time, I’ve tried to use this :
http://developer.coronalabs.com/forum/2011/08/19/detecting-dpi

But we need to know the size of each phone and tablet.

Can you help me to find a solution to answer to my first objective :

I would want that the stick takes place at the left of the screen when we play on tablet and at the center when we play on SmartPhone.

Thanks !

PS : Is it impossible to know the real size (in inch for example) of the screen ? [import]uid: 132686 topic_id: 29084 reply_id: 329084[/import]

Not possible to know real size in inches, no, only in pixels.

Would it be possible to check pixels and if width/height greater than X and not retina then call it a tablet, or if greater than Y and retina also call it a tablet? (For cases like iPad 3.) ? [import]uid: 52491 topic_id: 29084 reply_id: 117004[/import]

It’s what I did but some smartPhones like Xperia S has a better resolution than few tablet so … For example Xperia S 1280x720 pixels VS Iconia A500 (tablet) 1280x800. In a few months I’m afraid that certain smartPhone have a better resolution than certain tablets low cost and my gameplay have to change between smartPhone and Tablet.

ps : sorry for my english …

[import]uid: 132686 topic_id: 29084 reply_id: 117010[/import]

I do not believe with so many devices of varying resolutions that you can easily do this - maybe you should give the user the option of choosing where the stick appears? [import]uid: 52491 topic_id: 29084 reply_id: 117168[/import]

Yes I think it’s the better solution.
Thanks :wink: [import]uid: 132686 topic_id: 29084 reply_id: 117506[/import]