Saves variables until the app closes. All saved data will be lost afterwards.
See Also: GetData, ClearData
Example - Basic
function OnStart()
{
app.SetData( "myvar", "Hello World!" );
var data = app.GetData("myvar");
app.Alert( data, "Saved Data:" );
}
Example - Random Value
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
btn = app.AddButton( lay, "Press Me", 0.3, 0.1 );
btn.SetOnTouch( btn_OnTouch );
app.AddLayout( lay );
}
function btn_OnTouch()
{
var data = 100 * Math.random() | 0;
app.SetData( "number", data );
app.ShowPopup( "Data: " + app.GetData( "number" ));
}