Post Reply

[Q] Market update deletes the stored data

OP badcoke.com

2nd April 2014, 03:04 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: Apr 2014
I made an phonegap app, which is using websql for storing data. Everything works fine, it is on Google Play. The problem is when I update it (from the market) it erases all of the data which is stored in the websql. My question is, how can I solve this problem? How can I solve it, not to erase all of the data, when I update is?
2nd April 2014, 06:03 PM   |  #2  
Archer's Avatar
Senior Moderator / Recognized Developer - (Un)Recognized Pole Dancer
Flag Northampton
Thanks Meter: 4,103
 
10
13,868 posts
Join Date:Joined: Jul 2008
More
Quote:
Originally Posted by badcoke.com

I made an phonegap app, which is using websql for storing data. Everything works fine, it is on Google Play. The problem is when I update it (from the market) it erases all of the data which is stored in the websql. My question is, how can I solve this problem? How can I solve it, not to erase all of the data, when I update is?

The data associated with the app should only be deleted when you either uninstall the app or delete it manually (of course). Do you have anything in your code that initialises the database? I assume you create a database & table structure somewhere - are you sure you're not running that again?
Last edited by Archer; 2nd April 2014 at 06:10 PM.
3rd April 2014, 09:12 AM   |  #3  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: Apr 2014
Quote:
Originally Posted by Archer

The data associated with the app should only be deleted when you either uninstall the app or delete it manually (of course). Do you have anything in your code that initialises the database? I assume you create a database & table structure somewhere - are you sure you're not running that again?

I am sure, that that the database is not running again.
Here is my code:


Code:
function databaseFunction () {
var db,
len,
bx,
res = [];

this.open = function(levelDone) {
db = openDatabase('worderDd', '1.0', 'Test DB', 5 * 1024 * 1024);
var msg;
}

this.create = function() {
db.transaction(function (tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS worderDd (id INTEGER PRIMARY KEY AUTOINCREMENT, level)');
});
} 

this.addData = function (levelDone) {
db.transaction(function (tx) {
  tx.executeSql('INSERT INTO worderDd (level) VALUES (?)', [levelDone]);
  
    alert('AWWWWWWESOME! LEVEL COMPLETED');
window.location.replace("index.html");
});

}

Unfortunately the stored data is missing from this section of the code when update it through the market
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes