a

Wednesday, 12 August 2015

Local Data Storage

The App Properties module is used for storing application-related data in property/value pairs that persist beyond application sessions and device power cycles.


 Strore and Get a property
Ti.App.Properties.setString('givenName', 'Paul');
Ti.API.info('The value of the givenName property is: ' + Ti.App.Properties.getString('givenName'));

Output all the saved properties

var props = Ti.App.Properties.listProperties();

for (var i=0, ilen=props.length; i<ilen; i++){
    var value = Ti.App.Properties.getString(props[i]);
    Ti.API.info(props[i] + ' = ' + value);
}















No comments:

Post a Comment