iOS device info

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

iOS device info

Post by Kaubs » Thu Nov 17, 2011 8:20 pm

Is there a way to poll device info such as:

iOS version
agent - iphone, ipad, ipod

?

Thanks!!

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: iOS device info

Post by townsend » Thu Nov 17, 2011 8:56 pm

Have a look at the systemVersion statement.

Also look at the environment statement.

You can do something like,

Code: Select all

if the environment is "mobile" then
      ...
end if
To determine whether you're on an iPhone or iPad, I think you're going to have to look at the screen size.

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: iOS device info

Post by Kaubs » Thu Nov 17, 2011 10:27 pm

Right! Thank you. The systemversion worked great. I probably will have to go with screen res which is a little sad just because I cannot tell the diff between iPhone and iPod touch. I'm sure I can work something out though.

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: iOS device info

Post by townsend » Thu Nov 17, 2011 10:41 pm

What's the screen resolution of iPhones?
What the screen resolution of iPads?

Once you know that, build an IF statement.

Code: Select all

on mouseUp
     put width of stack "testing" && height of stack "testing"
end mouseUp

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: iOS device info

Post by Kaubs » Thu Nov 17, 2011 11:36 pm

I also just found that this works for me

Code: Select all

Put the platform into avariable
"the platform" defined my phone as and iPhone. I'm curious to see what all it can identify. This works better for me though as I dont have to try and track down a ton of screen resolutions in the future and cannot be limited to only iOS production with my stack.

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: iOS device info

Post by Kaubs » Fri Nov 18, 2011 1:25 am

One more question....how about obtaining a devices MAC address? Possible on iPhone or other devices?

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: iOS device info

Post by CALL-151 » Fri Nov 18, 2011 8:07 pm

Use the Machine function to identify iPhone vs iPad vs iPod Touch. It's explained in the release notes. I'm not aware of a LC method for obtaining the MAC address at runtime.

macnomad2
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 63
Joined: Sat Oct 28, 2006 10:04 pm

Re: iOS device info

Post by macnomad2 » Sat Nov 19, 2011 10:00 pm

And by the way,to differenciate iPad 1 and iPad 2, for speed reasons, have I something else than testing if there is a camera or not, just to be on the safe side ? I want to show more things on the faster device ;)
Thanks

Post Reply