Little Known Practical Use For An App’s Android OBB Folder System

The ability to retain the previous version’s file structure information when an APK update is performed and pass on that information to the updated version’s file structure can be a benefit.  There are two (2) possible existing conditions when performing an update:

  • If the information in the App’s associated files remains static (meaning no changes are made to those files when running the App) then there is no need to perform this mentioned operation.
  • However, if the information in the App’s associated files is dynamic (meaning changes are made to any or all of those files when running the App) then the options are either:
    • The user will have to manually reset those changes that were previously made that can be difficult to remember which information changed.
    • Or the user can do a “restore” by transferring the affected data from the App’s previous version’s associated files to the updated version’s associated files. If this route is chosen, then this brings the App’s OBB file structure into play.
  • Here is what happens:
    • App startup after installing update:
      • App checks the configuration file’s version number and the App’s version:
        • If there is not match, “ClearAllUserData” operation must be performed:
          • “C.A.U.D.” button is pressed:
            • Before the older version data files are cleared, the following occurs:
              • The remote SQLite database in the obb folder is deleted if it exists.  Then the local SQLite database in the data folder is copied to the remote folder.
              • Deletion of the remote restoration configuration file occurs next.  The local base restoration configuration file (it has only sections and key; however, no data) is copied to the local restoration configuration file.  Then the local restoration configuration file is moved to the remote folder.  Then the remote restoration configuration file is filled from the App’s configuration file.
          • App is closed and the older version data files (in the data folder only) are cleared via “ClearAllUserData” operation.
    • App restart:
      • The updated app’s database and configuration data are now being used.  This is verified the version match for the app and configuration file.
      • User must decide if they wish to restore the previous version’s data:  Note: This option is only offered once.
        • If yes, press the “Restore” button.
          • The remote “restore configuration file” is moved back to the local file system.
            • App’s configuration file is updated from the remote “restoration configuration file”.
          • Local SQLite database records are updated from the remote SQLite database records (using the attach<>table copy<>detach method).
        • If no, manual restoration will have to be performed.

That is it.  Operation settings are restored.