Deploy several stacks as an application to android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Deploy several stacks as an application to android

Post by gnor » Wed May 11, 2022 12:17 pm

Hello everyone!

Could someone be so kind to enlight me on the followings:

- i have 6 stacks in my application, in the standalone settings i have all stacks included int stack "a", but they are not substacks.
- deploying to windows did not shown any problem, works as a charm
- i have tried to deploy it to android but without avail

What i understand from posts, there is something i need to do, because the standalone settings for android does not support stacks options.
I do know it is written, tried several things, but seems i do not understand what should i do.
In the settings pane i have selected every possible inclusions, nothing happened. Given all possible permissions didnt help either.

Thanks

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Deploy several stacks as an application to android

Post by Klaus » Wed May 11, 2022 2:01 pm

Hi gnor,
- i have tried to deploy it to android but without avail
we definitively need to know what you already tried!

Did you follow this lesson and install everything neccessary?
https://lessons.livecode.com/m/4069/c/16395

Best

Klaus

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: Deploy several stacks as an application to android

Post by gnor » Wed May 11, 2022 3:11 pm

Thanks Klaus to drop in!

Yes i have set everything. Im still able to deploy for android if it is one stack only.
I ve read that there is different things i have to make if there is several stacks. Like use copy and paste instead of setting stacks in the deployment pane, but i did not get it. Halfen hour ago just deploy 1 stack application with 17 cards for android with no problem.
What i do not get is, that now i have 5-6 stacks with each of them has 5-6 cards.
Hope this makes it clearer...
Thanks

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Deploy several stacks as an application to android

Post by Klaus » Wed May 11, 2022 3:32 pm

Did you add these stacks via the "Copy files" tab in the "Standalone Application Settings..."?
If not, do so then you can access them in -> specialfolderpath("resources")

That specialfolder also works on the IDE, there it will point to the folder the current stack resides in,
So you can test everything also in the IDE.

Code: Select all

...
go stack (specialfolderpath("resources") & "/name_of_one_of_your_other_stacks_here.livecode")
...
Hint:
We cannot save these stacks in that folder, since we don't have write permission there on mobile!

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Deploy several stacks as an application to android

Post by Klaus » Wed May 11, 2022 5:29 pm

efore I forget: Add all of the resources (widget, Ask/Anser dialog, libraries etc.) in your stack that you make the runtime from!
Then add this in the openstack handler of that riuntime stack:

Code: Select all

...
start using this stack
...
This way, all of the sepearate stacks will be able to display widgets etc.!

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: Deploy several stacks as an application to android

Post by gnor » Wed May 11, 2022 6:17 pm

Thanks Klaus!

Will give it a try tomorrow when im at my computer. I will let you know how it went.

Thanks

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: Deploy several stacks as an application to android

Post by SparkOut » Wed May 11, 2022 7:50 pm

Also, as Klaus indicated but did not specifically spell out, when you save as a standalone on Android the external stacks will be bundled in the specialFolderPath("resources") folder which is sandboxed, and to open them, the app will need write permission in the location from which they are launched. Yes, write permission is needed *just to open the stacks, not only to save them later*.
So you will need to copy them on first run of the application from the specialFolderPath("resources") folder to the specialFolderPath("documents") folder and the launcher app will need to refer the stacks in that location for things to work.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Deploy several stacks as an application to android

Post by Klaus » Wed May 11, 2022 8:46 pm

Hm, since that is new to me, I just made a little test and had no problem
to open a stack in -> specialfolderpath("resources") on Android!
So no write permission neccessary!

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: Deploy several stacks as an application to android

Post by gnor » Thu May 12, 2022 6:21 am

hello!

Thanks for the help of you...
That is what i have done so far
In the runtime stack i've addaed use this stack in openstack handler.
where this code supposed to go?
(i assume if navigating thru stacks ? or only in the runtime stack?
still in shade....
...
go stack (specialfolderpath("resources") & "/name_of_one_of_your_other_stacks_here.livecode")
...

Thanks
Attachments
2.PNG
3.PNG
4.PNG

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: Deploy several stacks as an application to android

Post by gnor » Thu May 12, 2022 7:41 am

Sorry just an addition to the above:

On windows and in my code this stacks navigate to each other like :go to the stack "stackname" or go to the card "cardname" of stack "stackname"
In android should it go like: go stack (specialfolderpath("resources") & "/stackname.livecode") and if yes, how do i go to the special card of that stack?

That is what not clear to me...

Thank you

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Deploy several stacks as an application to android

Post by Klaus » Thu May 12, 2022 9:15 am

Hi gnor,

1. "start using this stack" goes into the "openstack" handler of the stack that you will create the rúntime from.
2. Just like the desktop:

Code: Select all

...
go cd 42 of stack (specialfolderpath("resources") & "/name_of_one_of_your_other_stacks_here.livecode")
...
3. I found that Android does not like files with an umlaut (ÄÜÖäüö etc. germany is umlaut country 8-)) in their names.
So maybe this is also the case with accents? If you encounter problems, you should change the filename of your stacks!


Best

Klaus

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: Deploy several stacks as an application to android

Post by gnor » Thu May 12, 2022 9:31 am

Thanks Klaus!

Yes, umlaut here is also the case. Thanks for ponting it out.

So everyvhere in my code i have to change the navigation lines, i've got it.
If i want to navigate back to the runtime stack from other stacks is it the same?
And also you have written earlier:"Add all of the resources (widget, Ask/Anser dialog, libraries etc.) in your stack that you make the runtime from!"

Do you mean in the standalonsettings of the runtime stack or somewhere else in script?
Sorry beeing so dump....

Thank you

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Deploy several stacks as an application to android

Post by Klaus » Thu May 12, 2022 10:02 am

Hi gnor,
gnor wrote:
Thu May 12, 2022 9:31 am
Yes, umlaut here is also the case. Thanks for ponting it out.
So everyvhere in my code i have to change the navigation lines, i've got it.
yes.
I've beenn bitten by that in the past! :-D
gnor wrote:
Thu May 12, 2022 9:31 am
If i want to navigate back to the runtime stack from other stacks is it the same?
No, since that stack is already in memory, you need to refer to it with its name, the one you gave it in the inspector!
Example
filename: yourruntimemainstack.livecode
name of stack: yourruntimemainstack

Then you need to script:

Code: Select all

...
go stack ""yourruntimemainstack"
...
You get the picture.
gnor wrote:
Thu May 12, 2022 9:31 am
And also you have written earlier:"Add all of the resources (widget, Ask/Anser dialog, libraries etc.) in your stack that you make the runtime from!"
Do you mean in the standalonsettings of the runtime stack or somewhere else in script?
Yes, in the standalonsettings of the runtime stack. This way, all of the external stacks will be able to use these resources, since we cannot add them to separate stacks.


Best

Klaus

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: Deploy several stacks as an application to android

Post by gnor » Thu May 12, 2022 10:15 am

THANK YOU VERY MUCH TO CLEAR IT FOR ME!

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Deploy several stacks as an application to android

Post by Klaus » Thu May 12, 2022 10:18 am

You are welcome!

Another important hint:
Android (and iOS) are case-sensitive OS!
So:
TABLET.livecode <> Tablet.livecode

Post Reply

Return to “Android Deployment”