I have come across two startup scripts on the Filemaker Starter Solution called Contacts. One uses Get(Device) and the other uses Get(System Platform) - see screenshots below.
Which is best practice?
Depends on what you want to detect. Get(systemplatform) will tell you for instance if someone on iOS but not whether they are on iPad or iPhone...
Look the two functions up in help and compare the results these two functions to see how they differ.
I looked at the help - I have then side by side (see below). After examining Get (Device), and because it is used in the 'starter solution called contacts I'm struggling to see where to use Get (SystemPlatform).
Like wimdecorte said, it depends on what is needed.
Get(SystemPlatform) is important to me, to know if I'm accessing the same file on WebDirect [as can been seen in the Examples Get(Device) will not detect if it is WebDirect], although I'm more apt to use Get(ApplicationVersion).
And the screen sizes for iPads and iPhones differ by quite a bit. A solution might thus have a set of layouts for iPhones and a different set for iPads. If so you need Get ( Device ) to distinguish between them in order to pop to the correct layout.
I'll have to give this a bit more thought - with 'IT_User' throwing the 'spanner' in the works, by introducing Get(ApplicationVersion).
I think the issues I'm having is if a general user is using WebDirect on a PC/Mac or tablet/phone.
So would this be correct for an Android phone
if(Get(systemPlatform) = 4 and get(Device) = 5
Go to some Android layout
For a WebDirect user on a Mac
if(Get(systemPlatform) = 4 and get(Device) = 1
Go to web styled minimal Dashboard
For a WebDirect user on a PC
if(Get(systemPlatform) = 4 and get(Device) = 2
Go to 'As above'
Retrieving data ...