Add config to specify whether save directory should be internal or external

Create issue
Issue #15 resolved
Martin Felis repo owner created an issue

Currently the save directory is in the internal storage area of the app. This has the benefit that it is properly deleted once the app is removed from the device. Using external storage area would have the nice feature that savegames and highscores could be kept even if the app was removed.

Adding

t.android.save_storage = "internal" -- or "external"

to the config would be nice.

Comments (8)

  1. Landon “Karai” Manning

    Is save_storage not configured in the manifest (install time)? Would this even be possible at the lua-level? It would be easy enough to change when compiling for publishing.

  2. Rami Sabbagh

    i use io library to save into the sdcard, but the problem that i can't delete files on the sdcard (but i found a hard way to fix it) ! or get dir items !

  3. Reenen Laurie

    Hi guys, in the "newer" android versions* it seems the data is now totally hidden from a filebrowser type view. The fact that on older androids it saved it under /sdcard/<myapp> was a feature that I used. This means that on newer androids the app is no longer extensible.

    Is this a tough nut to crack? Or is there some easy workaround such as forcing the app to [also] search /sdcard/<myapp>, meaning the customization feature stays?

    *: On my note 2 it saved the game data under /sdcard/HelpMeTalk while on my S5 I cannot find it at all.

  4. Martin Felis reporter

    Updated the android port to use the merged pull request. The config flag externalstorage was added to conf.lua. By default it is false, meaning you cannot access the files using a file browser. One should also note that it is not possible to switch between internal and external storage at runtime.

  5. Log in to comment