I think I can replicate the problem Samuel is seeing.
I don't know if this is a bug or not because I don't know if it is supposed to work but the behaviour is definitely different between the IDE and the apk
I have an app called app1 and in the same project beside app1.js I have app2.js
app1 attempts to start app2.js
In the ide, this appears to work (although app2 cannot report an accurate app.GetAppPath()).
However, from the apk, app2.js is rerun.
The code I have in app1.js is:
//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
//Create a text label and add it to layout.
txt = app.CreateText( "app1" );
txt.SetTextSize( 32 );
lay.AddChild( txt );
//Add layout to app.
app.AddLayout( lay );
setTimeout(loadapp,10000)
}
function loadapp()
{
newapp = app.GetAppPath()+
"/app2.js";
app.StartApp(newapp)
}
There is an spk with both files at.
http://hudl.sgarman.net/public/spk/app1.spk