Page 1 of 1
Is there any way to determine if I am building for Android or for iOS?
Posted: Tue Dec 25, 2018 7:21 pm
by Peter@multidesk.se
I want to copy a .lcext file to the copy files pane when I build for the android platform, and a pList when building to iOS.
As it is today, LC refuses to build for iOS if I have a .lcext file in the copy files pane.
Since there is a risk that I forget to copy the correct file, I would like to do this automatically when building my standalone file.
So my question is, Is it possible to see which platform you are building by using savingMobileStandalone?
Or is there any other way to solve this problem?
///Peter
Re: Is there any way to determine if I am building for Android or for iOS?
Posted: Tue Dec 25, 2018 11:30 pm
by jmburnod
Hi Peter.
Is it possible to see which platform you are building by using savingMobileStandalone?
the platform function should works
Best regards
Jean-Marc
Re: Is there any way to determine if I am building for Android or for iOS?
Posted: Wed Dec 26, 2018 12:08 am
by Peter@multidesk.se
I don't get it,
I want to distinguish between the two platforms I build for (iOS and Android) when I create the standalone file.
If I develop on a Mac and build for Android, will the the "platform function" not respond "MacOS" then?
Or have I missed something?
///Peter
Re: Is there any way to determine if I am building for Android or for iOS?
Posted: Wed Dec 26, 2018 10:23 am
by jmburnod
If I develop on a Mac and build for Android, will the the "platform function" not respond "MacOS" then?
Sorry, i was wrong. You're probably right.
Re: Is there any way to determine if I am building for Android or for iOS?
Posted: Wed Dec 26, 2018 10:50 am
by jmburnod
Hi Peter
I wonder if that is possible to get the hilite of checkbox "android" of window "standalone application setting"
You may get the long name of this checkbox using a trick of Klaus:
1. Put cursor over the checkbox "Android"
2. Type "put the long name of the mousecontrol" from messagebox
put the hilite of button "Build for Android" of group id 2063 of card "Android" of stack "/Applications/LiveCode Indy 9.0.1.app/Contents/Tools/Toolset/palettes/standalone settings/revstandalonesettings.8.rev" seems work.
I hope it also works from savingMobileStandalone.
Best
Jean-Marc
Re: Is there any way to determine if I am building for Android or for iOS?
Posted: Thu Dec 27, 2018 12:57 am
by jacque
The only way I know to do this is to set up the build for each platform independently. You can automate this via script, but you still need to specify which platform to build for. That is, you'd choose iOS only or Android only and then use a handler to automatically adjust the file inclusions before doing a build.
The standalone builder uses the settings stored in a custom property set called "cRevStandaloneSettings". It's an array that you can manipulate in a script. I do this for a project where I need to save a demo version and a full version, which I toggle with a checkbox. You could use a radio button group to toggle "iOS" and "Android", or just type "setup android" or "setup ios" into the message box.
Here's a rough example:
Code: Select all
on setup pPlatform
if pPlatform = "android" then
set the crevstandalonesettings["files"] of me to "<full path to .lcext file>"
set the crevstandalonesettings["android"] of me to true
set the crevstandalonesettings["iOS"] of me to false
else if pPlatform = "ios" then
set the crevstandalonesettings["files"] of me to "<full path to plist file>"
set the crevstandalonesettings["android"] of me to false
set the crevstandalonesettings["iOS"] of me to true
end if
-- if you're using radio buttons to trigger this, hide the radio group here
end setup
To see the other properties you can adjust, or to check the file paths you want to include, open the stack property inspector -> custom properties pane-> cRevStandaloneSettings property set. There are lots of things you can automate including the version and build numbers. I often adjust the Android build number ("version code") before building because Android won't install an app with the same build number as an existing copy on the device.
When you use this method, of course, you have to build each app separately after adjusting the properties for each. I'm not sure if you'll get two different standaloneSaving messages if you let LC do both at once, but if so there may be a way to query which platform is about to be built. If that's the case, I don't know what it is.
Re: Is there any way to determine if I am building for Android or for iOS?
Posted: Sat Dec 29, 2018 1:20 pm
by Peter@multidesk.se
Jacqueline,
Exactly what I was looking for!
Thanks
///Peter