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

Native Development

Reply
Highlighted
Contributor
Posts: 23
Registered: ‎01-11-2014
My Device: Z10
My Carrier: Vodafone
Accepted Solution

Persisting files across installations

I am working on an app which persists some information in an XML file in the data folder so that a user can close the app and then restart and still find the data in the XML file. All is working fine but when I reinstall the app, that particular file is overwritten, which I do not want. I want a particular file to be persisted across installations. Another use case can be, when user is upgrading the app then the file may be overwritted.

 

I tried googling a lot but somehow could not find the relevant information.

 

Is there a way to mark that some particlar folder is not cleaned during uninstallation?

Can someone pls help me with this ?

Developer
Posts: 508
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: Persisting files across installations

normally, you would store store information like that on a server (+ a credential like login / username pwd/ or sth unique like email-adress. hardwareIDs would not work across installations on different devices).

in general, when the user uninstalls his app, everything should be cleared. with a server (and a login), users can restore their data again

If you just create an app for yourself, you can try google app engine. it's free to use for smaller apps, but if it gets large, it can cost quite a bit
-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Persisting files across installations

when an app is uninstalled its sandbox is deleted, including its data directory.
the directory stays if you update the app.

if you really want to have something to remain you can use the shared folder, but i think that is a bad user experience to uninstall an app and have it leaving something behind. norton utilities style...
----------------------------------------------------------
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
Contributor
Posts: 23
Registered: ‎01-11-2014
My Device: Z10
My Carrier: Vodafone

Re: Persisting files across installations

Simon_hain,

 

If the data directory and all its contents stay intact on updating an app...then I think my pupose would be served...thats what I want...

 

Thanks !

 

 

Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Persisting files across installations

If you ARE worried saving something small after the user uninstalls and reinstalls the app (or letting the access it across devices), you can integrate with BlackBerry Profile: 

 

http://devblog.blackberry.com/2013/10/blackberry-10-2-identity-service-library-for-blackberry-id-and...

 

 

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker