Detect Phone vs. Tablet

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Detect Phone vs. Tablet

Post by joel.epsteinBUS31vi » Wed Mar 20, 2013 10:06 pm

Hi -

I'm sure this is easy, but I can't track it down.

I'm developing an iOS & Android app and I want to detect whether the device using the app has the ability to make a phone call. On iOS, I could simply check "the machine" to see if it's running on an iPhone (vs. iPad), but things aren't so easy on Android.

Could someone please point me in the right direction.

Thanks so much.

Joel

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Detect Phone vs. Tablet

Post by doobox » Sat Mar 23, 2013 2:33 pm

Not sure if you can detect this before the fact.
But if you were just wanting to perform an action after your app attempted to access the dialer on a device that does not have one, you could do this :

Code: Select all

on mouseUp
   launch url "tel:44 7818 8822"
   if the result is "no association" then
      answer "this device has no dialer"
   else
      answer "this device has got a dialer"
   end if
end mouseUp
Kind Regards
Gary

https://www.doobox.co.uk

joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: Detect Phone vs. Tablet

Post by joel.epsteinBUS31vi » Sat Mar 23, 2013 5:08 pm

Thanks!

This works well for me.

I appreciate your help.

Joel

Post Reply