05-17-2013 08:19 AM
I am using persistent object in blackberry to store config details specific to the app. Here is how I am implementing the class
public class Preferences implements Persistable
private static PersistentObject persistentObject = PersistentStore.getPersistentObject(0x2759d6ff7226
private static Hashtable tbl = new Hashtable();
public static void storeLoginToken(String token)
token = removeCharAt(token,0);
token = removeCharAt(token,token.length()-1);
public static String getLoginToken()
Hashtable tbl = (Hashtable)persistentObject.getContents();
String token = tbl.get("token").toString();
System.out.println("Token = "+token);
But if I uninstall/delete the app these stored values are not getting deleted. When I installs the app for next time the app is fetching the old stored values.
How can i do this properly in blackberry? Thanks
05-17-2013 09:31 AM
Use your own class, so extend Hashtable and persist that.
I thnk this question has been answered a number of times on the foirum already, so I recommend you use the search facilty before asking a question.
Also try typing "Persistent" in the Search box for a nmmber of useful KB articles that talk about persistence.
05-19-2013 10:24 AM
you just need to wrapped you data in your Own class even if it's only primitive data types
and make sure that your class is inherits from persistence class