commit 2dde8656985d91df3510ef8c700cc2327a272af2
Author: leszek <leszek@koltunski.pl>
Date:   Fri Nov 14 12:05:42 2025 +0100

    Progress remembering solves.

diff --git a/build.gradle b/build.gradle
index ea8e8aa0..21b02c88 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,7 +47,7 @@ buildscript {
         mavenCentral()
     }
     dependencies{
-        classpath 'com.android.tools.build:gradle:8.13.0'
+        classpath 'com.android.tools.build:gradle:8.13.1'
         classpath 'com.google.gms:google-services:4.4.2'
         classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.3'
     }
diff --git a/src/main/java/org/distorted/dialogs/DialogAbout.java b/src/main/java/org/distorted/dialogs/DialogAbout.java
index a1dc6e3b..34526b5d 100644
--- a/src/main/java/org/distorted/dialogs/DialogAbout.java
+++ b/src/main/java/org/distorted/dialogs/DialogAbout.java
@@ -33,7 +33,7 @@ import org.distorted.main.R;
 public class DialogAbout extends DialogAbstract
   {
   private static final String WHATS_NEW =
-      "1. If you made at least 8 moves, then the solve attempt gets automatically remembered. You can resume your solve at any later time.\n" +
+      "1. If you made at least 7 moves, then the solve attempt gets automatically remembered. You can resume your solve at any later time.\n" +
       "2. A fix to the solved-state detection of the Container.\n" +
       "3. Every tutorial has been checked and a few non-working ones have beed replaced.\n" +
       "4. Fixes for scrambling: now (almost!) every puzzle should scramble perfectly, i.e. every scramble in level N should be exactly N moves from the solved state."
diff --git a/src/main/java/org/distorted/helpers/RubikRememberedSolves.java b/src/main/java/org/distorted/helpers/RubikRememberedSolves.java
index 7e116bc5..f1474220 100644
--- a/src/main/java/org/distorted/helpers/RubikRememberedSolves.java
+++ b/src/main/java/org/distorted/helpers/RubikRememberedSolves.java
@@ -18,19 +18,18 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.io.BufferedReader;
-import java.io.BufferedWriter;
+import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
 import java.nio.charset.StandardCharsets;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 public class RubikRememberedSolves
 {
-  private static final int MAXSOLVES = 8;
+  private static final int MAXSOLVES = 5;
   private static RubikRememberedSolves mThis;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -81,8 +80,8 @@ public class RubikRememberedSolves
       String contents = readContents(file);
       return new JSONArray(contents);
       }
-    catch(IOException iex)    { android.util.Log.e("D", "readFile: failed to read file" ); }
-    catch(JSONException jex)  { android.util.Log.e("D", "readFile: failed to parse file"); }
+    catch(IOException iex)    { android.util.Log.e("D", "readFile: failed to read file: "+iex.getMessage() ); }
+    catch(JSONException jex)  { android.util.Log.e("D", "readFile: failed to parse file: "+jex.getMessage()); }
 
     return null;
     }
@@ -108,21 +107,17 @@ public class RubikRememberedSolves
     {
     String filename  = objname.toLowerCase()+"_solves.json";
     RubikFiles files = RubikFiles.getInstance();
-    InputStream file = files.openFile(act,filename);
-    RubikRememberedSolves solves = RubikRememberedSolves.getInstance();
-    String contents = solves.addInfo(file,level,time,rot,quats);
+    InputStream input= files.openFile(act,filename);
+    String contents  = addInfo(input,level,time,rot,quats);
+    File file        = new File(act.getFilesDir(), filename);
 
-    try
+    try( FileOutputStream fos = new FileOutputStream(file) )
       {
-      FileOutputStream fos = new FileOutputStream(filename);
-      OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
-      BufferedWriter bw = new BufferedWriter(osw);
-      bw.write(contents);
-      bw.flush();
+      fos.write(contents.getBytes(StandardCharsets.UTF_8));
       }
     catch(IOException ex)
       {
-      android.util.Log.e("D", "failed to save file "+filename);
+      android.util.Log.e("D", "failed to save file "+filename+" : "+ex.getMessage());
       }
     }
 
@@ -160,8 +155,8 @@ public class RubikRememberedSolves
         lvl.put(data);
         return levels.toString();
         }
-      catch(IOException iex)    { android.util.Log.e("D", "addInfo: failed to read file" ); }
-      catch(JSONException jex)  { android.util.Log.e("D", "addInfo: failed to parse file"); }
+      catch(IOException iex)    { android.util.Log.e("D", "addInfo: failed to read file: "+iex.getMessage() ); }
+      catch(JSONException jex)  { android.util.Log.e("D", "addInfo: failed to parse file: "+jex.getMessage()); }
       }
     else
       {
@@ -181,7 +176,7 @@ public class RubikRememberedSolves
           levels.put(save);
           }
         }
-      catch(JSONException jex)  { android.util.Log.e("D", "addInfo: failed to parse file"); }
+      catch(JSONException jex)  { android.util.Log.e("D", "addInfo: failed to parse file: "+jex.getMessage()); }
 
       return levels.toString();
       }
diff --git a/src/main/java/org/distorted/main/MainObjectPopup.java b/src/main/java/org/distorted/main/MainObjectPopup.java
index 63dcb320..d582d409 100644
--- a/src/main/java/org/distorted/main/MainObjectPopup.java
+++ b/src/main/java/org/distorted/main/MainObjectPopup.java
@@ -264,7 +264,6 @@ public class MainObjectPopup
           mPopup.dismiss();
           if( ll<0 ) scores.setRecord(mObjectOrdinal,ll,0); // remember we've entered the 'Free'
                                                             // so that the button turns green
-
           JSONArray json= null;
           int numSolves = 0;
 
@@ -272,7 +271,8 @@ public class MainObjectPopup
             {
             try
               {
-              json = mRememberedSolves.getJSONArray(ll);
+              int lvl = ll==LEVELS_SHOWN ? ll : ll+1;
+              json = mRememberedSolves.getJSONArray(lvl);
               numSolves = json.length();
               }
             catch(JSONException jex)
diff --git a/src/main/java/org/distorted/play/ScreenSolving.java b/src/main/java/org/distorted/play/ScreenSolving.java
index 1f53e175..28521e70 100644
--- a/src/main/java/org/distorted/play/ScreenSolving.java
+++ b/src/main/java/org/distorted/play/ScreenSolving.java
@@ -29,7 +29,7 @@ import java.util.TimerTask;
 
 public class ScreenSolving extends ScreenBase
   {
-  private static final int MOVES_THRESHHOLD = 8;
+  private static final int MOVES_THRESHHOLD = 6;
 
   private TextView mTime;
   private Timer mTimer;
