SDL_GetAndro...alStoragePath(3)

πŸ’– SDL_GetAndroidExternalStoragePath πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual β€” this one's called SDL_GetAndroidExternalStoragePath(3) and it's literally the glow-up guide to finding your app's external storage folder. let's get into it ✨


🌸 NAME 🌸

SDL_GetAndroidExternalStoragePath β€” get the path used for external storage for this Android application. no cap, that's the whole vibe 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_system.h>

const char * SDL_GetAndroidExternalStoragePath(void);

she takes no arguments, she returns a const char *, she's lowkey effortless πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this path is unique to your application, but β€” and this is the part you gotta hear β€” it's public and it can be written to by other applications. it's giving "shared apartment, everyone has a key" 😭 not private, not locked down, just out there.

your external storage path is typically:

/storage/sdcard0/Android/data/your.app.package/files

and bestie, this is a C wrapper over android.content.Context.getExternalFilesDir(), so if you wanna read the actual Android docs (iykyk), they live here:

https://developer.android.com/reference/android/content/Context#getExternalFilesDir()


⭐ RETURN VALUE ⭐

  • on success: returns the path used for external storage for this application πŸ₯³
  • on failure: returns NULL πŸ’€ and you should call SDL_GetError() for more information, because she will tell you what went wrong fr fr

πŸ‘‘ AVAILABILITY πŸ‘‘

this function is available since SDL 3.2.0. old-heads stay mad, we're on the new stuff ✨


🌈 SEE ALSO 🌈

go read those too, they're the friend group 🫢


Simple Directmedia Layer wrote this one, it's SDL 3.4.18, and that's the whole page β€” mwah πŸ’‹ thanks for reading, you ate that, periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from