The App Properties module is used for storing application related property/value pairs which persist beyond application sessions.
| Name | Description |
|---|---|
| addEventListener | add an event listener for the instance to receive view triggered events |
| fireEvent | fire a synthesized event to the views listener |
| getBool | return a boolean value |
| getDouble | return a double value |
| getInt | return an integer value |
| getList | return a value as an array |
| getString | return a string value |
| hasProperty | returns true if the property exists |
| listProperties | return an array of property propertys |
| removeEventListener | remove a previously added event listener |
| removeProperty | remove an existing property |
| setBool | set a property as a boolean value |
| setDouble | set a property as a double value |
| setInt | set a property as an integer value |
| setList | set a property as an array value |
| setString | set a property as a string value |
In this example, we store a string property:
Titanium.App.Properties.setString("my_prop","cool");
In this example, we print out all the saved properties to the console:
var props = Titanium.App.Properties.listProperties(); for (var c=0;c<props.length;c++) { var value = Titanium.App.Properties.getString(props[c]); Titanium.API.info(props[c]+" = "+value); }