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

Android™ Development

Reply
Highlighted
New Contributor
Posts: 4
Registered: ‎02-29-2012
My Device: None
My Carrier: None

SQLite database is lost when reinstalling android converted app on BB10 device

I am porting an Android app to BB10 and I have this problem: every time I reinstall it in order to check the UI adjustments, my SQLite database is lost. This is happening both on the simulator and on a Z10 phone.

 

It is a significant problem for me because the app needs the user to enter some info when the app is installed - so I have to repeat the process on every reinstall.

 

I am using Eclipse for Mobile Developers.

 

Is there a setting in Eclipse or the simulator that will prevent a clean install every time? Or is there another solution?

 

Thank you in advance.

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: SQLite database is lost when reinstalling android converted app on BB10 device

Hi serbanescu,

 

The whereabouts of your database.db file will dictate whether or not it gets overwritten on reinstall of your app.

 

   Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
New Contributor
Posts: 4
Registered: ‎02-29-2012
My Device: None
My Carrier: None

Re: SQLite database is lost when reinstalling android converted app on BB10 device

Hi Justin,

 

Thank you for the answer. I am not that much experienced with SQLite, could you explain a little?

 

I am managing the database with an SQLiteOpenHelper object. On Android works fine (only the Java code gets updated, the database is not overwritten). Where in the SQLiteOpenHelper code did I have to make a change in order to get the same result on BlackBerry 10?

 

Thank you in advance.

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: SQLite database is lost when reinstalling android converted app on BB10 device

Ah, okay. I wasn't sure if you were using a custom database location (that may get overwritten) or not.

 

Would you be able to file a Jira here:

https://www.blackberry.com/jira/secure/Dashboard.jspa

 

Include the description of the problem and maybe a sample application so that the devs can test against it.

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
New Contributor
Posts: 9
Registered: ‎09-02-2013
My Device: z10
My Carrier: T-Mobile

Re: SQLite database is lost when reinstalling android converted app on BB10 device

[ Edited ]

I filed a jira ticket for this issue:  https://www.blackberry.com/jira/browse/BBTEN-1680

Trusted Contributor
Posts: 160
Registered: ‎11-17-2010
My Device: PlayBook, Z10, Q10

Re: SQLite database is lost when reinstalling android converted app on BB10 device

Hi,

 

Your db also gets deleted if you reinstall your app from the command line using blackberry-deploy instead of eclipse?

This could be a workaround when you need to keep the persisted data.

--
If you find this post useful please Like it.
If it solves your problem please mark as solution.