Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

New Developer
Posts: 8
Registered: ‎12-18-2010
My Device: Not Specified

Saving User Settings/Preferences

[ Edited ]



I was wondering what is the recommended way of saving user settings or preferences (that is, persisting settings/preferences so that they can be restored in the future). Is there BlackBerry API for doing that, or should we just use SQLLite database that came with AIR? Thanks in advance for your help.

Posts: 167
Registered: ‎12-17-2010
My Device: Bold 9000
My Carrier: Vodafone

Re: Saving User Settings/Preferences

Hi franse,


As far as I know you should use the SharedObject class to store data persistently.

You can find many examples on the internet.





My PlayBook App: Checklists
Posts: 22
Registered: ‎12-17-2010
My Device: Not Specified

Re: Saving User Settings/Preferences

Hello franse,


you can transparently serialize any object to the disk:


            flash.net.registerClassAlias("FooClass", FooVO);        
            var soSmiley FrustratedharedObject = SharedObject.getLocal("config");
            so.data.config = config;

and read it again:

            flash.net.registerClassAlias("FooClass", FooVO);
            var soSmiley FrustratedharedObject = SharedObject.getLocal("config");           
            var foo:FooVO = so.data.config;




Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Saving User Settings/Preferences

You have many choices to pick.


SQLite db file if you have a lot of structed information to store, like game scores.


If you just have preference settings (maintain application state between sessions), you can also use XML.


Both these are good because they can be inspected outside the application when something does not seem right.


In all cases, preferences should be stored in the application storage directory.


Posts: 278
Registered: ‎10-27-2010
My Device: Playbook

Re: Saving User Settings/Preferences

I agree with jtegen, plenty of choices out there. I find the sqlite solution quick and easy, though.

Accepted PlayBook Applications:
HDB Converter -- Utilities/Calculators