Determine if device is a tablet

J. Landman Gay jacque at hyperactivesw.com
Wed Aug 15 02:32:17 EDT 2018


On 8/14/18 11:13 PM, Richard Gaskin via use-livecode wrote:
> J. Landman Gay wrote:
> 
>  > I need to determine whether the current mobile device is a tablet or a
>  > phone. On iOS I can use "the machine" but on Android it only provides
>  > the manufacturer's name.
>  >
>  > Does anyone know a way to do that?
> 
> For screen metrics or device capabilities?
> 

Metrics. I want to allow landcape orientation on tablets but only 
portrait for phones.

Phil suggested getting device info, but mobileBuildInfo doesn't return 
anything better than "the machine." The server idea doesn't return 
specific enough info either if it isn't an i-thing.

Monte mentioned the screenrect, which is what I started with, but it's a 
wild guess. Right now I'm using an arbitrary screen pixel width but I 
don't think it will work everywhere.

I thought about using a ratio but I'm not sure what would be most 
accurate. And I'm not clear on how different resolutions affect it.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list