How to make SDL_AndroidGetExternal/InternalStoragePath return app specific folders

Hi everybody.

I’m sorry if this is already documented somewhere, I can’t seem to find it…

I use SDL_AndroidGetExternalStoragePath to download some extra assets for my app.

  • I renamed my app in AndroidManifest.xml from org.libsdl.app to com.test.game
  • I set the activity from SDLActivity to MyGameActivity
  • I created java/com/test/game/MyGameActivity.java which imports org.sld.app and extends SDLActivity.

When I call SDL_AndroidGetExternalStoragePath I’d expect to get something like
/data/data/com.test.game/files/
but I get
/data/data/org.libsdl.app/files

as if I didn’t rename the app at all.

This is undesirable, as it will mix my downloaded resources with all stuff written by other SDL apps.

Probably I forgot to change a org.libsdl.app to com.test.game somewhere?

regards,

I think I solved it. It’s nowhere in any readme but you also need to change the default project to be built in

<android-project>/app/build.gradle

I’ll leave this message here for future reference as I have been scratching my head for hours before I found this last occurence of org.libsdl.app that needed changing.