BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-18-2009, 04:17 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default how to Delete persistenceStore

Please Login to Remove!

Hi all,

I am new to Blackberry development. I am using persistenceStore and persistenceObject for storing my data through a HashMap. How do i delete the persistence store while deleting the app. How and when do I invoke the PersistentStore.destroyPersistentObject(). Read that this method would delete the object. Can anyone help with sample code?
Offline  
Old 08-18-2009, 10:04 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

A persistent store is deleted from the device when the last application using it is removed, or when the structure of the store as coded in an application is different from the structure of the store on the device.

Other than that, you may destroy your store when ever it makes sense for the operation of your program.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-19-2009, 07:50 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 8310
PIN: N/A
Carrier: Airtel
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am storing the data as string and when i delete the application from the device. After i install the application again if find the persistance store still exists.
Offline  
Old 08-19-2009, 08:10 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

This KB article has the specifics, and links to other documents. Maybe you can find your answer there: Livelink - Redirection
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-21-2009, 07:28 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: none
PIN: N/A
Carrier: none
Posts: 26
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Store it in a Persistable object whose class is defined in your application. So, for example, instead of storing it in a Hashtable, store in MyHashtable like this

Quote:
public class MyHashtable extends java.util.Hashtable implements Persistable {
}
This way when your application is uninstalled, the persistent entry created with your class will be removed as well.

Quote:
Originally Posted by deepakjain View Post
I am storing the data as string and when i delete the application from the device. After i install the application again if find the persistance store still exists.
Offline  
Old 10-21-2009, 06:31 PM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2009
Model: Tour
PIN: N/A
Carrier: Verizon
Posts: 84
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Properties/Methods of Parent class not available in the child?

Sorry every one--don't know how that happened. I thought I was in a new thread.
__________________
Don

Handspring Visor -> Handspring Visor Deluxe -> Palm Treo 650 on VZW -> Palm Treo 700p on VZW -> Blackberry Tour 9360 on VZW

Last edited by doni49 : 10-21-2009 at 06:33 PM.
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.