Determine if device is a tablet

Terry Judd terry.judd at unimelb.edu.au
Wed Aug 15 03:11:14 EDT 2018


So, iPhones (5 and above) have an aspect ratio of something like 1.78, versus 1.33 for an iPad. Don't know what sort of range you are likely to find with Android devices but perhaps using a value of below 1.4-1.5 to indicate the device is a tablet would work for the majority?

Terry...

On 15/08/2018 4:32 pm, "use-livecode on behalf of J. Landman Gay via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:

    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
    
    _______________________________________________
    use-livecode mailing list
    use-livecode at lists.runrev.com
    Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
    http://lists.runrev.com/mailman/listinfo/use-livecode
    
    



More information about the use-livecode mailing list