xhsyy / omnidroid

Automatically exported from code.google.com/p/omnidroid
Apache License 2.0
1 stars 0 forks source link

ResetDB button not working properly #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.click on the button

What is the expected output? What do you see instead?
Should wipe out the database except user defined rules, but it doesn't do
anything. The debug info shows the DbData gets called, but the new data is
not show in the database.

The purpose of the button is reset the database when use update the App. It
should work automatically. User should not need to click the button(i.e.
There shouldn't be this button).

So the next step would be to figure out how App update works, what are the
functions get called.

Original issue reported on code.google.com by beanxlj@gmail.com on 7 May 2010 at 6:29

GoogleCodeExporter commented 9 years ago
It did something. It dropped all the tables in the Database except those 
related to user saved rules, and recreated them with necessary app information.

Are you sure the reason for this button is to upgrade the Database? I think the 
onUpgrade in class edu.nyu.cs.omnidroid.app.model.db.DbHelper can do this job.

Original comment by huangf100 on 9 Jun 2010 at 2:04

GoogleCodeExporter commented 9 years ago
I agree onUpgrade() seems like the proper place for database updates with new 
releases.  I think ResetDB would be a failsafe in the event that the 
onUpgrade() didn't work (either if it wasn't written yet, or if there was a bug 
so that it caused problems with the app).  Effectively a way to reset the 
application data store without having to result to a full uninstall then 
reinstall.

Original comment by case.and...@gmail.com on 9 Jun 2010 at 3:59

GoogleCodeExporter commented 9 years ago
Seems to work.  Beanxlj, if you think this is incorrect, please reopen with 
further details.

Original comment by case.and...@gmail.com on 22 Jun 2010 at 8:43