Welcome!

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

Java Development

Reply
Developer
safycool
Posts: 198
Registered: ‎04-03-2009
Accepted Solution

Delete Persistent Storage on uninstallation

How can I delete the persistent storage when the application gets uninstalled....

 

Because when i install the application with the same database name I want a fresh copy of perssistent storage

 

 

 

Thanks..

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Carrier: ***

Re: Delete Persistent Storage on uninstallation

Store instances of your persistable classes and in this case these objects will be removed when your app uninstalled.

 

 

Please use plain text.
Developer
safycool
Posts: 198
Registered: ‎04-03-2009

Re: Delete Persistent Storage on uninstallation

the persistent  does not get deleted when the application is uninstalled....

 

When i install the application with the same persistent storage name... the old entries are retrieved which

 

were stored in persistent storage.

 

To get the new database I have to delete it.... or create a new database(i.e different new  persistent storage name) to get the new

 

persistent storage...

 

 

 

Thanks....

Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009

Re: Delete Persistent Storage on uninstallation

Try with reseting during uninstallation.

Somthing like:

 

javaloader -usb erase -f applicationName.cod

 

Regards

Bikas

 

Please use plain text.
Developer
safycool
Posts: 198
Registered: ‎04-03-2009

Re: Delete Persistent Storage on uninstallation

1) I am using DesktopManager to uninstall the application

 

Also tried

 

2) deleting the application from Option-->Security Options...

 

But in both cases the persistent storage does not get deleted.

 

 

What in case of end user who uninstalls the application from desktop managers

 

 

Can you please explain how can i use the above command.....

 

 

But is it possible to delete the database via desktop manager...

 

Do I need to add something in the code..so that the database gets deleted when it is uninstalled....

 

 

Thanks...

Please use plain text.
Developer
simon_hain
Posts: 15,558
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Delete Persistent Storage on uninstallation

tbilisoft is right, maybe you misunderstood him.

see
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800708/800647/How_To_...
for a more in-depth explaination.

if you use standard classes the store stays, if you use your own classes it goes.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Carrier: ***

Re: Delete Persistent Storage on uninstallation

[ Edited ]

If you are using Vector, String class instances to store data in Persistent Store it will remain after app is uninstalled.

 

But if you stored instances of your classes like:

 

class MyStorageBlock implements Persistable {

 

       private String myData;

       ...........

}

 

then all these objects will be removed when your app is uninstalled.

 

It does work for me and for my customers.

Message Edited by tbilisoft on 21-07-2009 01:06 PM
Please use plain text.
Developer
safycool
Posts: 198
Registered: ‎04-03-2009

Re: Delete Persistent Storage on uninstallation

Yes I am storing Vector in the Persistent storage.

 

if I create a follwing class

 

public class MyVector extends Vector implements Persistable {

}

 

Will that data be deleted on uninstallation

Please use plain text.
Developer
simon_hain
Posts: 15,558
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: Delete Persistent Storage on uninstallation

yes
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Carrier: ***

Re: Delete Persistent Storage on uninstallation

If you store MyVector instance it will be deleted when your app is uninstalled.
Please use plain text.