sdlGetAndroidInternalStoragePath function

String? sdlGetAndroidInternalStoragePath()

Get the path used for internal storage for this Android application.

This path is unique to your application and cannot be written to by other applications.

Your internal storage path is typically: /data/data/your.app.package/files.

This is a C wrapper over android.content.Context.getFilesDir():

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

\returns the path used for internal storage or NULL on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

\sa SDL_GetAndroidExternalStoragePath \sa SDL_GetAndroidCachePath

extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidInternalStoragePath(void)

Implementation

String? sdlGetAndroidInternalStoragePath() {
  final sdlGetAndroidInternalStoragePathLookupFunction = libSdl3.lookupFunction<
      Pointer<Utf8> Function(),
      Pointer<Utf8> Function()>('SDL_GetAndroidInternalStoragePath');
  final result = sdlGetAndroidInternalStoragePathLookupFunction();
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}