Skip to content

Feature Request: File pickers on UIKit and Android #9657

Description

@Ravbug

The new SDL FileDialog API is amazing. I would love to see file choosers on non-desktop platforms, because it would greatly assist users in importing and exporting save data from games, among other things.

UWP has the FileOpenPicker and FolderPicker documented here: https://learn.microsoft.com/en-us/windows/uwp/files/quickstart-using-file-and-folder-pickers. They give sample code in C# but the C++ equivalent is probably very similar. As far as I am aware, this is also supported on UWP for Xbox.

UIKit has the UIDocumentPickerViewController, documented here: https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller. It's available on iOS and visionOS. You can choose folders by passing kUTTypeFolder into the documentTypes parameter of the UIDocumentPickerViewController constructor.

Android has ACTION_OPEN_DOCUMENT and ACTION_OPEN_DOCUMENT_TREE which prompt the system to display a DocumentsProvider and return the chosen items as content:/// URLs. It's documented here: https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT. It may require JNI interop to invoke.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions