Skip to content

Add Support for Android/media additionally to Android/data #377

@DrPepperBianco

Description

@DrPepperBianco

Hi,

if I want to add bought Keen versions, like Keen5 or Keen6 I have to put files into the Android/data folder. Problem is, that since Android changed some security rules for this folder, this only works via adb (over USB or over WLAN).

Instead you could add the Android/media folder. Then you could move the files there with any Android file manager (like the stock file manager files).

In the file "FindFile.cpp" I found the following lines (at about line 500):

    AddToFileList(&basesearchpaths, "/switch/CommanderGenius");
    AddToFileList(&basesearchpaths, "romfs:/");
#else // all other systems (Linux, *BSD, OS/2, ...)
#ifdef ANDROID
    //AddToFileList(&basesearchpaths, "${HOME}/SaveData");
    AddToFileList(&basesearchpaths, SDL_AndroidGetExternalStoragePath());
    AddToFileList(&basesearchpaths, SDL_AndroidGetInternalStoragePath());
    AddToFileList(&basesearchpaths, "/storage/emulated/0/Android/data/net.sourceforge.clonekeenplus/files/SaveData");
#else
    #ifdef ALTERNATE_HOME
      AddToFileList(&basesearchpaths, ALTERNATE_HO

The line
AddToFileList(&basesearchpaths, SDL_AndroidGetExternalStoragePath());
adds the "Android/data" path to the search path list.

In the SDL there seems to be no method to get the "Android/media" path. But in the end, you only have to replace "Android/data" with "Android/media" I guess.

I have to admit, I am no expert in either C++ or Android programming. I didn’t even find out, how to compile this code for android. So I am not sure, if it works this way. Anyway, it would make it easier to add games to on Android.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions