Android Kivy在哪里放置应用程序文件(ini,images db等) [英] Android kivy where to put application files (ini, images db etc)

查看:151
本文介绍了Android Kivy在哪里放置应用程序文件(ini,images db等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用kivy为Android创建了一个原型应用程序.它已在buildozer中编译,并且我已上传到Android设备.

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

但是我不确定在哪里放置与应用程序相关的文件,如ini文件,图像数据库等.

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

任何帮助表示赞赏

推荐答案

您可以安排它们的口味-只要您告诉buildozer包括apk(即通过设置要包含的文件类型,目录等)和访问权限即可它们以及代码中的相对路径,它们将在设备上以相同的方式工作.

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.

ini文件可能是一个例外,我不确定kivy试图从哪个位置加载它(但是它可能在外部数据目录中的某个位置).如果无法将其与main.py放在同一目录中,则可以手动使用相对路径加载它,或者如果它只有几个值,则可以在main.py文件中进行设置.

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.

这篇关于Android Kivy在哪里放置应用程序文件(ini,images db等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆