I'm in the process of porting a LiveCode app to Android and I'm having a problem getting the library stacks that are not sub-stack to start.
I have a main stack, two sub-stacks and 5 libary stacks for the application.
The library stacks are located in a folder called /lib, so multiple apps can access a commen set
I have listed the stack to be included with the package in Standalone Application Settings
in the preOpenStack I have the following code
Code: Select all
on preOpenStack
global gLibraryStackName
if the environment = "mobile" then
set the defaultFolder to specialFolderPath("engine")
set the rect of this stack to the screenrect
resizeStack
mobileSetAllowedOrientations("Portrait", "landscape left", "landscape right")
else
set the itemDelimiter to "/"
get the fileName of this stack
set the defaultFolder to item 1 to -2 of it
end if
-- Start the libraries
if "MobileLocalization" is not among the lines of the StacksInUse then
start using stack "MobileLocalization"
end if
if "MobileConnect" is not among the lines of the StacksInUse then
start using stack "MobileConnect"
end if
if "DataValidation" is not among the lines of the StacksInUse then
if the environment = "development" then
start using stack "../lib/saverDataValidation.livecode"
else if the environment = "mobile" then
put defaultFolder & "saverDataValidation.livecode" into gLibraryStackName
start using stack gLibraryStackName
else
start using stack "saverDataValidation.livecode"
end if
end if
if "ErrorHandlers" is not among the lines of the StacksInUse then
if the environment = "development" then
start using stack "../lib/saverErrorHandlers.livecode"
else if the environment = "mobile" then
put defaultFolder & "saverErrorHandlers.livecode" into gLibraryStackName
start using stack gLibraryStackName
else
start using stack "saverErrorHandlers.livecode"
end if
end if
end preOpenStack
On my main card I have a function to display the StacksInUse as well as the global variable that is set to show the location of where the software is looking for the stack to start.
Only the Sub-Stacks are started, the other stacks are not started when the StacksInUse are listed.
Location of the stacks is defined to be /data/app/com.XAC.saver-01.apk/saverDataValiation.livecode
Indicating that the software hangs when it first tries to start the first external stack => saverDataValidation.livecode
From the documentation, I understand that a read-only package is created in the "engine" location, so I expect that I should be able to open the stacks from there.
I must be doing something wrong in accessing the stacks or are external stacks a problem in Android?
Thanks for the help