<LoadDialog>:
title: 'load file'
size_hint: .9, .9
BoxLayout:
size: root.size
pos: root.pos
orientation: 'vertical'
FileChooserListView:
id: filechooser
path: '/data/data/org.test.myapp'
BoxLayout:
size_hint_y: None
height: 30
CommonButton:
text: 'Cancel'
on_release: root.dismiss()
CommonButton:
text: 'Load'
on_release: root.load(filechooser.path, filechooser.selection)
I googled and understood that it's permission problem, but i use in my buildozer.spec this code:
android.permissions = READ_EXTERNAL_STORAGE
And in settings of my app i set permission for storage:
Help please and thanks!
To acquire these permissions you have to ask for them in your app by:
from android.permissions import request_permissions, Permission
request_permissions([Permission.WRITE_EXTERNAL_STORAGE,
Permission.READ_EXTERNAL_STORAGE])
... and the user will be asked to your App to access the storage.
The android
library is included in the buildozer builds, so that request is all you have to do...
To get the internal storage path:
from android.storage import primary_external_storage_path
SD_CARD = primary_external_storage_path()
Note that this is the virtual (internal) SD card of the system."
request_permissions([Permission.WRITE_EXTERNAL_STORAGE,
Permission.READ_EXTERNAL_STORAGE])
a = request_permissions([Permission.WRITE_EXTERNAL_STORAGE,
Permission.READ_EXTERNAL_STORAGE])
print(a)