storage - Why do Android updates of my app erase information? -


in app, have list of objects stored fileoutputstream in code below. also, have settings in app stored sharedpreferences. whenever updated app on google play store first time (for unfamiliar process, upload new apk), objects deleted using app, , settings set default. why did , how can have objects stored don't disappear after update?

public objectstorage readlistfromfile() {     objectstorage temp = null;     string filename = "storefileobj";     fileinputstream fis;     try {         fis = getactivity().openfileinput(filename);         objectinputstream = new objectinputstream(fis);         temp = (objectstorage) is.readobject();         is.close();     } catch (filenotfoundexception e) {         // todo auto-generated catch block         e.printstacktrace();     } catch (streamcorruptedexception e) {         // todo auto-generated catch block         e.printstacktrace();     } catch (ioexception e) {         // todo auto-generated catch block         e.printstacktrace();     } catch (classnotfoundexception e) {         // todo auto-generated catch block         e.printstacktrace();     }      return temp; }   public void updatestorage() {      string filename = "storefileobj";     fileoutputstream fos;     try {         fos = getactivity().openfileoutput(filename, context.mode_private);         objectoutputstream os = new objectoutputstream(fos);         os.writeobject(mainobjectlist);         os.close();     } catch (filenotfoundexception e) {         // todo auto-generated catch block         e.printstacktrace();     } catch (ioexception e) {         // todo auto-generated catch block         e.printstacktrace();     }  } 

for normal updates, users not have lost these values.

i believe each of users lost stored sharedpreference , saved file data forced delete old application in order install new application play store. otherwise, of keys or file formats must have changed.

signature:

you used android's signing applications documentation in order update @ play store, perhaps users in question using app signed different signature (such debug mode signature) had delivered them separately. explain why forced uninstall before updating @ play store, erasing of saved information.

data format:

another alternative perhaps keys used sharedpreference values changed or file format or class structure objectstorage changed, making impossible read old values. appear users if old values disappeared. then, users saved values in new format, app continue work them.

summary:

one of following must have happened:

  1. your users deleted before reinstall. or,
  2. your stored data format changed between versions.

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -