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

夙愿已清 提交于 2020-01-03 16:41:19

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/29911991/android-kivy-where-to-put-application-files-ini-images-db-etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!