-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: File pickers on UIKit and Android #9657
Comments
Sounds great, feel free to post a PR implementing one or more of those. :) |
Posting the original idea I had here: I planned to add a function similar to the existing file dialogs, but instead of treating with path strings, it would treat with I wanted to investigate into the various platforms (at least iOS/Android, but also console and Emscripten) to understand how they work before developing the interface, but I haven't yet finished my research. If somebody else is working on it, please let me know so that I don't duplicate the work. |
I have an idea for Android and may try to get my hands on it next week. Since Android returns
With this method, the filelist can be kept as So how would be 3rd-party apps retrieve the filename? It's not possible to deduce the filename from If there are things that you want to know or want me to know, feel free to tell me. |
(Removed UWP from title since WinRT support is gone in SDL3.) |
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
andFolderPicker
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 passingkUTTypeFolder
into thedocumentTypes
parameter of theUIDocumentPickerViewController
constructor.Android has
ACTION_OPEN_DOCUMENT
andACTION_OPEN_DOCUMENT_TREE
which prompt the system to display a DocumentsProvider and return the chosen items ascontent:///
URLs. It's documented here: https://developer.android.com/reference/android/content/Intent#ACTION_OPEN_DOCUMENT. It may require JNI interop to invoke.The text was updated successfully, but these errors were encountered: