#primary sdcrd path is ok .but path of secondary sd card is none
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from android import storage
app_storage_path = storage.app_storage_path()
print(f'app_storage_path: {app_storage_path}')
primary_external_storage_path = storage.primary_external_storage_path()
print(f'primary_external_storage_path: {primary_external_storage_path}')
secondary_external_storage_path = storage.secondary_external_storage_path()
print(f'secondary_external_storage_path: {secondary_external_storage_path}')
#persistent_keystore_path = cls.get_persistent_keystore_path()
#print(f'persistent_keystore_path: {persistent_keystore_path}')
#non_persistent_keystore_path = cls.get_non_persistent_keystore_path()
#print(f'non_persistent_keystore_path: {non_persistent_keystore_path}')
Builder.load_string('''
#: import storagepath plyer.storagepath
<StoragePathInterface>:
BoxLayout:
orientation: 'vertical'
BoxLayout:
Button:
text: 'Home'
on_press: label.text = str(storagepath.get_home_dir())
Button:
text: 'External Storage'
on_press:
label.text = str(storagepath.get_external_storage_dir())
BoxLayout:
Button:
text: 'Root'
on_press: label.text = str(storagepath.get_root_dir())
Button:
text: 'Documents'
on_press: label.text = str(storagepath.get_documents_dir())
BoxLayout:
Button:
text: 'Downloads'
on_press: label.text = str(storagepath.get_downloads_dir())
Button:
text: 'Videos'
on_press: label.text = str(storagepath.get_videos_dir())
BoxLayout:
Button:
text: 'Music'
on_press: label.text = str(storagepath.get_music_dir())
Button:
text: 'Pictures'
on_press: label.text = str(storagepath.get_pictures_dir())
Button:
text: 'Applications'
on_press: label.text = str(storagepath.get_application_dir())
Label:
id: label
''')
class StoragePathInterface(BoxLayout):
pass
class StoragePathApp(App):
def build(self):
return StoragePathInterface()
if __name__ == "__main__":
StoragePathApp().run()
######adb log
11-01 18:14:28.341 8580 8664 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
11-01 18:14:29.273 8580 8664 I python : app_storage_path: /data/user/0/org.test.plyerstoragepath/files
11-01 18:14:29.290 8580 8664 I python : primary_external_storage_path: /storage/emulated/0
11-01 18:14:29.299 8580 8664 I python : secondary_external_storage_path: None
11-01 18:14:29.631 8580 8664 I python : [INFO ] [Window ] Provider: sdl2