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.

Note: Before your application closes, remove objects from the runtime store that your application no longer requires. If you add an object instance to the runtime store and don't remove it, you could create a memory leak.

Was this information helpful? Send us your comments.