【发布时间】:2018-07-02 03:04:11
【问题描述】:
我即将将我的游戏发布到 google play 商店,并且该游戏包含保存数据。
我这样写数据:
public static void write_to_file(String filename, String data){
try{
FileOutputStream fos = MainActivity.current_context.openFileOutput(filename + ".txt", Context.MODE_PRIVATE);
OutputStreamWriter osw = new OutputStreamWriter(fos);
try{
osw.write(data);
osw.close();
}
catch(IOException e){
Log.d("DataManager", "Attempted to write to file: " + filename + ".txt" + " couldn't write.");
}
}
catch(FileNotFoundException e){
Log.d("DataManager","Attempted to write to file: " + filename + ".txt" + " not found!");
}
}
当我在手机上手动卸载游戏,然后再次运行应用程序时,数据会像往常一样被删除。但是当我发布我的应用程序的新版本时,会发生同样的事情吗?目前,我对下载新版本应用程序的看法会卸载当前版本并安装新版本。但是我真的不确定,有人可以澄清一下吗?
【问题讨论】:
标签: android google-play