BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-02-2009, 05:39 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8350i
PIN: N/A
Carrier: telus
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default persistent store

Please Login to Remove!

Hello Everyone.

Having a minor issue with persistent store. I have a class called c_settings as you can see below which holds settings within my app. Is there a way to store this in a persistent store without first transfering the values to another type. (ie. boolean array and integer array) I tried just using _settings and everything works without throwing an error but my data doesn't appear to get loaded.

c_settings _settings = new c_settings();
class c_settings
{
boolean _case;
boolean _refresh;
boolean _audio;
int _volume;
int _length;
}
Offline  
Old 11-02-2009, 06:43 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

How about using a hash table? This allows you to set key/value pairs, and it is already persistable.
Offline  
Old 11-03-2009, 04:55 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Sep 2009
Model: 8100
PIN: N/A
Carrier: Airtel
Posts: 75
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can store the object of c_settings class as a PersistentObject by implementing Persistable interface...

public class c_settings implements Persistable{

}
Offline  
Old 11-05-2009, 07:07 PM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2009
Model: 8350i
PIN: N/A
Carrier: telus
Posts: 40
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great!!! I'll try that.
Offline  
Old 12-08-2009, 09:39 AM   #5 (permalink)
New Member
 
Join Date: Nov 2009
Location: NYC
Model: 8320
PIN: N/A
Carrier: AT&T
Posts: 13
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Watch out, though... off the top of my head I believe if you uninstall your app (specifically the module that contains the class), it will wipe the object out of the persistent store since the class is no longer available. But if you save individual ints and booleans they will stay there.

My app saves preferences in a class and if you uninstall, they vanish!
__________________
Instantly grab contacts and appointments into your BlackBerry with Copy2Contact - www.copy2contact.com
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.