kivy/kivymd filechooser under Android

482 views
Skip to first unread message

markus

unread,
May 28, 2023, 1:21:47 PM5/28/23
to Kivy users support
Hello kivy support group,

I have a question regarding kivy/kivymd file choosers under android 10 and above. I wrote a kivy app and I want to select a file on the storage of an android device. It works, but only on smartphones with android in version <10. I searched the web for a solution and I found this androidstorage4kivy . It seems to work, I can select a file, but I do not know how to get the file path of the selected file. Does anybody know how I can handle that? I tried the native kivy/kivymd file chooser, but then I have no permission to access the files/folders. I hope someone can help me.

Kind regards

markus

Charles longwe

unread,
May 28, 2023, 4:41:07 PM5/28/23
to kivy-...@googlegroups.com
have u set  write storage access permissions??? yes plyer works but for android try to use pyjinius library.......................


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/f178d46b-c293-4d06-9e74-af82686adaacn%40googlegroups.com.

markus

unread,
May 28, 2023, 5:23:06 PM5/28/23
to Kivy users support
Hi,
yes, I have set the write_external_storage permission. Despite it I have no permission to access files and folders under Android. It would be nice to use the native filechooser of kivy or kivymd. Which pyjnius library do you mean?

Robert

unread,
May 28, 2023, 5:24:51 PM5/28/23
to Kivy users support
Plyer file chooser does not work on latest Android versions. Kivy/KivyMD file chooser has not worked for a long time.
Because Shared Storage is not a file system https://github.com/Android-for-Python/Android-for-Python-Users#android-storage

For androidstoragekivy, did you read the documentation?

markus

unread,
May 28, 2023, 5:30:40 PM5/28/23
to Kivy users support
Thanks for the info. I read the documentation. Now it works with androidstoragekivy.

Robert

unread,
May 28, 2023, 5:33:29 PM5/28/23
to Kivy users support
🙂

markus

unread,
May 28, 2023, 5:36:49 PM5/28/23
to Kivy users support
Does androidstoragekivy work with all Android versions?

Robert

unread,
May 28, 2023, 7:09:25 PM5/28/23
to Kivy users support
As far as I know yes.

But some care is required, the detailed behavior of the shared storage apis has changed with Android versions.
No attempt is made to implement lowest common denominator checking.

And with android.api =33, the names of the permissions changed https://github.com/Android-for-Python/Android-for-Python-Users#storage-permissions I have not tried this but I'm told that it works.

markus

unread,
Jun 3, 2023, 6:30:58 PM6/3/23
to Kivy users support
Hi,
I still have a question. I use androidstorage4kivy to select a mp3 file. This works. But when I select a mp3 file with a slash in the song title of the metadata it doesn't work. What is the reason for that?
Message has been deleted

Robert

unread,
Jun 3, 2023, 8:46:16 PM6/3/23
to Kivy users support
Just because!
Reply all
Reply to author
Forward
0 new messages