How to save text files on android
in
Android Processing
•
2 years ago
Hello everyone , I have a working game in the market, and I only tested it on my phone wich is a samsung galaxy android 2.2
the thing is, some of the users are saying that their phones do not save the levels, and that means that my save system is not working on their phones.
Problem is, I do not know what phone they have or what version of android they are using , i know for a fact that the xpria x10 mini does not save the file, but I have no idea why.
the code I use to save the files I need is the following
- String[] cX = new String[nMax];
- for (n=0; n<nMax;n++) {
- if (hitX[n]!=0) {
- hitX[n]=width/hitX[n];
- }
- cX[n] = hitX[n]+"";
- }
- saveStrings("x.txt", cX);
- String[] cY = new String[nMax];
- for (n=0; n<nMax;n++) {
- if (hitY[n]!=0) {
- hitY[n]=height/hitY[n];
- }
- cY[n] = hitY[n]+"";
- }
- saveStrings("y.txt", cY);
- }
- try {
- String[] strokesdone = loadStrings("\\turtle\\ownStrokes.txt");
- for (n=0; n<35;n++) {
- ownstrokes[n] = int(strokesdone[n]);
- }
- }
- catch (NullPointerException e) {
- String[] strokesdone = new String[nlvl];
- for (n=0; n<nlvl;n++) {
- strokesdone[n] = 10+"";
- }
- saveStrings("\\turtle\\ownStrokes.txt", strokesdone);
- }
Basicly loadStrings and saveStrings work fine on my phone samsung galaxy S,v 2.2.0, but i do not know why it doesnt work on some phones, and i actually do not know if it has to do with android version or not.
Anyone ever had a similar problem?
thats the link to the free demo of my game , please download,play it and tell me if your phone saves, if it does not, please tell me the make of your phone and the android version, I really need to get this sorted!
1