Save a number value to remember varibale values between multiple app starts and updates.
Example - Click Counter
var clicks = 0, file = "demofile";
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
clicks = app.LoadNumber( "clicks", 0, file );
btn = app.CreateButton( "Click Me", 0.5, 0.1 );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
app.SaveNumber( "clicks", ++clicks, file );
app.ShowPopup( "Clicks: " + clicks );
}