Application data, how to do it?

23 views
Skip to first unread message
Assigned to tais...@gmail.com by me

Tais

unread,
Jan 19, 2019, 6:18:51 PM1/19/19
to Kivy users support
Please tell me, I am interested in methods for obtaining data paths storage applications such as images, jnson.
I created the apk with buildozer, but the method that works in Windows 

_dir = dirname(__file__)
dir_img = _dir + 'data/img'
dir_json = _dir + '/data/json'

...doesn't work in Android.

In logs there is an error:

I/python  (11849): IOError: The folder '/data/json' doesn't exist!



Tais

unread,
Jan 19, 2019, 6:47:18 PM1/19/19
to Kivy users support
main.py:
_dir = dirname(abspath(__file__))
dir_json = _dir + '/data/json'

logcat:
I/python  (20770): IOError: The folder '/data/data/org.test.apptest/files/app/data/json' doesn't exist!

Tais

unread,
Jan 21, 2019, 3:29:55 AM1/21/19
to Kivy users support
the problem was solved in this way: the program itself creates the necessary folders and files.
Reply all
Reply to author
Forward
0 new messages