Storing objects nonpersistently
The runtime store provides a central location for applications to store and share information on a smartphone. Data in the runtime store is not saved when the smartphone is restarted. The RuntimeStore API was introduced with BlackBerry Device Software 3.6.
The runtime store is implemented in the net.rim.device.api.system.RuntimeStore class.
Objects are stored using a key-value pair. When you store an object in the runtime store, you assign the object a unique ID of type long and later use the ID to retrieve the object from the store. You can generate the unique ID in the Eclipse editor by right-clicking the fully-qualified class name and clicking Convert 'name' to long.
- Common uses of the runtime store
- Security of the runtime store
- Add an object to the runtime store
- Replace an object in the runtime store
- Retrieve the runtime store
- Retrieve a registered runtime object
- Retrieve an unregistered runtime object
- Code sample: Storing a String in the runtime store
- Code sample: Getting a stored String from the runtime store
- Code sample: Creating a singleton using the RuntimeStore API