Page 4 of 5

Re: save content of field

Posted: Tue Dec 07, 2021 12:27 am
by jacque
Samuele wrote: Mon Dec 06, 2021 9:42 pm anyone has any idea why it doesn't let me save as standalone the splash stack with the working in it?
I've lost track of what you've done so far, but the working stack cannot be a substack. It has to be its own mainstack. You include it in the Copy Files pane of the standalone settings.

I've never seen that dialog before. It looks like the bottom is cut off, is there more info in the dialog that we can't see?

Re: save content of field

Posted: Tue Dec 07, 2021 3:16 am
by dunbarx
but the working stack cannot be a substack.
@Samuele I thought we had gotten through that. The "working" stacks HAVE to be stacks living in SEPARATE stack files.

Craig

Re: save content of field

Posted: Tue Dec 07, 2021 10:38 am
by stam
dunbarx wrote: Tue Dec 07, 2021 3:16 am The "working" stacks HAVE to be stacks living in SEPARATE stack files
Late in the discussion and tbh TL;DR ;)
so apologies if i'm just re-iterating what's been said before...

@samuele:
As the /Applications folder is often a non-writeable location, you keep your immutable stack (the splash stack which will then become the standalone app) there, and it then calls the mutable working stack which is stored in a writeable location (eg app support folder, documents etc).
So the stacks have to be different files because they have to reside in different directories/folders.

Your immutable splash stack manages launching the main working stack as a normal stack, not as stand alone (obviously on desktop you should cater for the possibility this may not exist so you should have a copy within the your standalone app directory to copy to the desired location etc - less of an issue for mobile...).

To avoid problems originating from preOpen/Open scripts (for example the splash stack calling the mainstack) i found i have to close all stacks, suspend messages (Development menu -> suspend messages), open the splash stack, build my app, then allow messages again. I prefer this to filling my stack with code just to build the app and it works very well for me.

Re: save content of field

Posted: Thu Dec 16, 2021 11:55 am
by Samuele
B"H, thanks to everyone! for now it works B"H!!

Re: save content of field

Posted: Thu Dec 16, 2021 2:49 pm
by dunbarx
Trying to stay up to date.

What is B"H?

Craig

Re: save content of field

Posted: Thu Dec 16, 2021 6:01 pm
by Samuele
nope, i thought it worked, but the fact is i didn't save st standalone the slplash stack, but the working one :roll: :shock: so i tried again and the splash stack doesn't work entirely, it brings me to the working stack but then all the widgets are purple and disabled so i can't go forward on the app, any ideas, (and also when the pc saved as standalone the splash stack it was much less heavy, maybe that's why the widgets won't work 'cause the pc didn't save the standalone correctly, i don't know...)
thanks

Re: save content of field

Posted: Thu Dec 16, 2021 6:04 pm
by Samuele
its a lot stranger because on my "try" splash stack, it worked perfectly and the widgets were shown, but the working stack itself in the "try" was very light difference of the acyual stack i want to save with the splash(the apk is 140 mb) maybe it's for its heaviness... booo

Re: save content of field

Posted: Thu Dec 16, 2021 6:18 pm
by Klaus
Did you really add all this to your "SPLASH" stack:
viewtopic.php?f=7&t=36499&start=30#p211119
?
Especially:

Code: Select all

...
start using this stack
...

Re: save content of field

Posted: Thu Dec 16, 2021 6:30 pm
by Samuele
yep, that's my stack "splash" script

Code: Select all

function isBuildingStandalone
   return (the environment is "development" AND there is a stack "revStandaloneProgress" AND the mode of stack "revStandaloneProgress" > 0)
end isBuildingStandalone

on openstack
   if isBuildingStandalone() then
      exit openstack
   end if
   ## Neccessary so all opened stacks can access the inclusions of stack "SPLASH"!
   start using this stack
   
   ## Prepare filenames:
   ## Stack in RESOURCES
   put specialfolderpath("resources") & "/clickMe.livecode" into tSourceStack
   
   ## Stack in DOCUMENTS folder
   put specialfolderpath("documents") & "/clickMe.livecode" into tTargetStack
   
   ## check if we already opened the app = the WORKING stack is already in DOCS folder
   if NOT (there is a stack tTargetStack) then
      
      ## Now copy the stack to the DOCS folder
      put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
   end if
   
   ## NOW we can open that "new" stack that NOW can be saved
   go stack tTargetStack
   hide stack "SplashSource"
end openstack
Screenshot 2021-12-16 at 18.30.01.png

Re: save content of field

Posted: Thu Dec 16, 2021 6:35 pm
by Samuele
and this
photo_2021-12-16 18.31.52.jpeg
is the view from mobile, you can see the purple rectangle, that's supposed to be a text entry android widget, but there it's just a purple rectangular... (and also the icon in the middle)...

Re: save content of field

Posted: Thu Dec 16, 2021 6:56 pm
by Klaus
OK, just wanted to be sure.

Hm, in the "Standalone Application Settings" did you select:
-> Search for required inclusions when saving the standalone application
or
-> Select inclusions for the standalone application

The automatism of the first option does not work reliably, so maybe that is the problem...

Re: save content of field

Posted: Thu Dec 16, 2021 7:31 pm
by Samuele
Klaus wrote: Thu Dec 16, 2021 6:56 pm Hm, in the "Standalone Application Settings" did you select:
-> Search for required inclusions when saving the standalone application
or
-> Select inclusions for the standalone application

The automatism of the first option does not work reliably, so maybe that is the problem...
i tried with both of the options and none of the two work :?

Re: save content of field

Posted: Thu Dec 16, 2021 8:55 pm
by dunbarx
Klaus is right about the automatic inclusion gadget not being reliable. Doing it by hand always works. That said, one must be perfect in selecting ALL the required inclusions.

Craig

Re: save content of field

Posted: Thu Dec 16, 2021 9:03 pm
by Klaus
Samuele wrote: Thu Dec 16, 2021 7:31 pmi tried with both of the options and none of the two work :?
So you selected -> Select inclusions for the standalone application and then you manually checked
all neccessary inclusions on the "Inclusions" card in the "Standlone Application Settings"?

Re: save content of field

Posted: Sun Dec 19, 2021 12:19 pm
by Samuele
Klaus wrote: Thu Dec 16, 2021 9:03 pm
Samuele wrote: Thu Dec 16, 2021 7:31 pmi tried with both of the options and none of the two work :?
So you selected -> Select inclusions for the standalone application and then you manually checked
all neccessary inclusions on the "Inclusions" card in the "Standlone Application Settings"?
yes, i did that and now all the inclusions (such as android native field ecc.) seem to work, but "save this stack" doesn't work, not even now that the app has its splash stack, and that was the reason i made the splash stack at first.
to sum up: i added in the standalone settings of the splash stack the "working" stack (in "copy files) then i general ➜ inclusions i selected "Select inclusions for the standalone application", then in the inclusions tab i selected all the required inclusions.
this is the stack script of the "splash stack"

Code: Select all

function isBuildingStandalone
   return (the environment is "development" AND there is a stack "revStandaloneProgress" AND the mode of stack "revStandaloneProgress" > 0)
end isBuildingStandalone

on openstack
   if isBuildingStandalone() then
      exit openstack
   end if
   ## Neccessary so all opened stacks can access the inclusions of stack "SPLASH"!
   start using this stack
   
   ## Prepare filenames:
   ## Stack in RESOURCES
   put specialfolderpath("resources") & "/clickMe.livecode" into tSourceStack
   
   ## Stack in DOCUMENTS folder
   put specialfolderpath("documents") & "/clickMe.livecode" into tTargetStack
   
   ## check if we already opened the app = the WORKING stack is already in DOCS folder
   if NOT (there is a stack tTargetStack) then
      
      ## Now copy the stack to the DOCS folder
      put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
   end if
   
   ## NOW we can open that "new" stack that NOW can be saved
   go stack tTargetStack
   hide stack "SplashSource"
end openstack
and after all this on mobile "save this stack" doesn't work. :D
any ideas?
thanks!