AndroidNativeFileDialog

This plugin is obsolete starting with Godot 4.6, as Storage Access Framework support has been implemented in Android: Implement Storage Access Framework (SAF) support by syntaxerror247 · Pull Request #112215 · godotengine/godot · GitHub :tada:

I made a plugin to avoid asking for MANAGE_EXTERNAL_STORAGE if you need to access files outside the app’s own storage. It’s meant to be a temporary solution until full Storage Access Framework support gets implemented.

Why not simply request the permission?

Google doesn’t like it, since it grants access to all files on the phone. I also don’t like giving random apps access to all files, but Google really doesn’t like it.

Why would I need this?

You might want the user to be able to load patches or mods via pck files, which they will probably download from a 3rd party.

You might also be making an app that has to import files (either to display, or modify, or one of the many other potential reasons).

How does it work?

It will display the native Android file dialog and allow the user to choose which files to grant your app access to. It will then copy all files selected (without blocking the main thread) into the user:// directory, where you can access them as usual with FileAccess. More details on the Github page.

I swear I’ve heard this before!?

There are other similar plugins, such as:

Why not use the other ones?

You can, especially if you are using a version prior to Godot 4.5. This one has a few more options, such as allowing you to prompt the user for a single file, multiple files, and choose which directory within user:// to copy the files into. You can also specify a mime type, maximum file size and allowed extensions.

1 Like