Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android kivy where to put application files (ini, images db etc)

I've created a prototype application for Android using kivy. It has compiled in buildozer and I've uploaded in to an Android device.

But I'm nor sure where to put app dependent files like the ini file, images database etc.

Any help greatly appreciated

[EDIT 2020 07 25]

When I asked this question (many moons ago) I was new to kivy and the whole idea of buildozer.

What I didn't realise and what isn't obvious to a beginner (witness the number of times this question has been viewed) and which @inclement's answer does not address, is that Buildozer wraps the whole python/kivy project into a single file which can include all of your static data. So you just need to make sure your buildozer spec picks them up.

like image 536
Psionman Avatar asked Apr 28 '15 06:04

Psionman


1 Answers

You can arrange them to taste - as long as you tell buildozer to include them apk (i.e. by setting the file types, directories etc to be included) and access them with relative paths in your code, they will work the same way on the device.

The ini file may be an exception, I'm not sure offhand where kivy tries to load it from (but it may be somewhere in the external data dir). If putting it in the same directory as main.py doesn't work, maybe you could load it manually with a relative path, or if it has just a few values then you could set them in the main.py file.

like image 74
inclement Avatar answered Nov 09 '22 12:11

inclement