Determine if device is a tablet
Phil Davis
revdev at pdslabs.net
Tue Aug 14 20:18:45 EDT 2018
Hi Jacque,
One idea: If your app can reach out to a LC page on a server, that page
could return $_SERVER["HTTP_USER_AGENT"] which in many cases tells
something about the kind of device that connected. For example:
An old iPad:
Mozilla/5.0 (iPad;CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1 (KHTML,
like Gecko)
My phone:
Mozilla/5.0 (iPhone;CPU iPhone OS 11_4_1 like Mac OS X)
AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/68.0.3440.83
An old Samsung tablet:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/65.0.3325.109 Safari/537.36
Just grasping at straws here. Better info is hidden somewhere in the
bowels of the device. It would be cleaner to just get it directly.
Phil Davis
On 8/14/18 4:15 PM, J. Landman Gay via use-livecode 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?
>
--
Phil Davis
More information about the use-livecode
mailing list