Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

request_permissions stops work

100 views
Skip to first unread message

Radosław Głębicki

unread,
Mar 1, 2025, 1:59:54 PMMar 1
to Kivy users support
Hi.
This is part of my Python/Kivy app.
Always work now after system/python/kivy upgrade and after installation to android there is no question about permissions.

from android.permissions import request_permissions, Permission
request_permissions([Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE])

No error no nothing app start normal. One thing only. Compare to previous version this installing so fast, to fast. Strange fast.

Python 3.12.9
Kivy   2.3.0
What more about versions?

Radek Glebicki

Mathias Lindström (kuzeyron)

unread,
Mar 4, 2025, 1:01:49 PMMar 4
to Kivy users support
Check your settings on the device. You have probably enabled the permissions before this.

Radosław Głębicki

unread,
Mar 4, 2025, 8:52:20 PMMar 4
to Kivy users support
on Android 13 there is nothing and permissions question is during first start.


"
Storage Permissions

On devices running Android 10 and later, no permissions are requires to read or write an app's own shared storage or private storage. An app cannot modify another app's shared file.

If android.api < 33 reading another app's shared storage requires READ_EXTERNAL_STORAGE permission.

If android.api >= 33 use one or more of READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO, READ_EXTERNAL_STORAGE see Android docs. Despite what it says in the Android docs, READ_EXTERNAL_STORAGE is required only to read another app's shared file when the file is part of the Documents collection.

There is one special case which is different from typical desktop usage. An app cannot read another app's file in the Downloads directory, regardless of permissions.

On devices running Android 9 and less, WRITE_EXTERNAL_STORAGE is required for any file writes. Or READ_EXTERNAL_STORAGE if the app only wants to do shared storage reads.

"
I have to understand and test in my app.

berk berk

unread,
Mar 5, 2025, 5:09:22 PMMar 5
to Kivy users support
you know this rule, if something is work well don't touch it.  ^ ^

5 Mart 2025 Çarşamba tarihinde saat 04:52:20 UTC+3 itibarıyla glebicki...@gmail.com şunları yazdı:

Radosław Głębicki

unread,
Mar 5, 2025, 7:58:38 PMMar 5
to Kivy users support
So, I should stay on Fedora 21 with Python 3.1 or what. Did you read my last post, yes? Maybe some tips. No? Hold your wise tips for yourself.

Radosław Głębicki

unread,
Mar 7, 2025, 9:44:44 PMMar 7
to Kivy users support
I made step forward.
in buildozer.spec this line:

android.permissions = android.permission.WRITE_EXTERNAL_STORAGE, android.permission.READ_EXTERNAL_STORAGE, android.permission.MANAGE_EXTERNAL_STORAGE

and in python is:

from android.permissions import request_permissions, Permission
gjoGranted = request_permissions([Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE])

So, now ask during start about access and in app I can read only media files but not text files. Even when I not choose by touch (because I don't see txt file) but I write name I get 'Permission denied'. Why??

berk berk

unread,
Mar 8, 2025, 9:55:58 AMMar 8
to Kivy users support
it seems Android permission update after 'android 11(api 30) [*1, *2] 

alternative solution is kivy filechooser. (did you try it? )

from kivy.uix.filechooser import FileChooserListView
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.app import App

class MyApp(App):
    def build(self):
        layout = BoxLayout(orientation='vertical')
        self.file_chooser = FileChooserListView()
        btn = Button(text="Dosya Seç", on_press=self.open_file)
        layout.add_widget(self.file_chooser)
        layout.add_widget(btn)
        return layout

    def open_file(self, instance):
        selected = self.file_chooser.selection
        if selected:
            with open(selected[0], 'r', encoding='utf-8') as file:
                print(file.read())

MyApp().run()


*1: https://developer.android.com/about/versions/11/privacy/storage 
*2: https://stackoverflow.com/questions/62782648/android-11-scoped-storage-permissions

8 Mart 2025 Cumartesi tarihinde saat 05:44:44 UTC+3 itibarıyla glebicki...@gmail.com şunları yazdı:

Radosław Głębicki

unread,
Mar 8, 2025, 11:57:44 AMMar 8
to Kivy users support
I am using `FileChooserListView()`. How did you think I am opening files with Kivy on Android. And where in your code is something about permissions? I don't understand purpose of your post.

berk berk

unread,
Mar 8, 2025, 1:29:29 PMMar 8
to Kivy users support
i specified as *1 and *2
Also It's not clear what you want from the beginning to end of the post.
8 Mart 2025 Cumartesi tarihinde saat 19:57:44 UTC+3 itibarıyla glebicki...@gmail.com şunları yazdı:
Reply all
Reply to author
Forward
0 new messages