Is there any way to determine if I am building for Android or for iOS?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Is there any way to determine if I am building for Android or for iOS?

Post by Peter@multidesk.se » Tue Dec 25, 2018 7:21 pm

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
/*Whats all the fuss with c# ?*/

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Is there any way to determine if I am building for Android or for iOS?

Post by jmburnod » Tue Dec 25, 2018 11:30 pm

Hi Peter.
Is it possible to see which platform you are building by using savingMobileStandalone?
the platform function should works
Best regards
Jean-Marc
Last edited by jmburnod on Wed Dec 26, 2018 10:14 am, edited 1 time in total.
https://alternatic.ch

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: Is there any way to determine if I am building for Android or for iOS?

Post by Peter@multidesk.se » Wed Dec 26, 2018 12:08 am

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
/*Whats all the fuss with c# ?*/

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Is there any way to determine if I am building for Android or for iOS?

Post by jmburnod » Wed Dec 26, 2018 10:23 am

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.
https://alternatic.ch

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Is there any way to determine if I am building for Android or for iOS?

Post by jmburnod » Wed Dec 26, 2018 10:50 am

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
https://alternatic.ch

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Is there any way to determine if I am building for Android or for iOS?

Post by jacque » Thu Dec 27, 2018 12:57 am

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: Is there any way to determine if I am building for Android or for iOS?

Post by Peter@multidesk.se » Sat Dec 29, 2018 1:20 pm

Jacqueline,

Exactly what I was looking for! :D

Thanks


///Peter
/*Whats all the fuss with c# ?*/

Post Reply

Return to “iOS Deployment”