• <tfoot id='WDOoh'></tfoot>
      <bdo id='WDOoh'></bdo><ul id='WDOoh'></ul>
    <legend id='WDOoh'><style id='WDOoh'><dir id='WDOoh'><q id='WDOoh'></q></dir></style></legend>

      1. <i id='WDOoh'><tr id='WDOoh'><dt id='WDOoh'><q id='WDOoh'><span id='WDOoh'><b id='WDOoh'><form id='WDOoh'><ins id='WDOoh'></ins><ul id='WDOoh'></ul><sub id='WDOoh'></sub></form><legend id='WDOoh'></legend><bdo id='WDOoh'><pre id='WDOoh'><center id='WDOoh'></center></pre></bdo></b><th id='WDOoh'></th></span></q></dt></tr></i><div id='WDOoh'><tfoot id='WDOoh'></tfoot><dl id='WDOoh'><fieldset id='WDOoh'></fieldset></dl></div>
      2. <small id='WDOoh'></small><noframes id='WDOoh'>

      3. 在 Android 上的 kivy 中保存应用数据

        时间:2023-09-01

                <bdo id='ghLdc'></bdo><ul id='ghLdc'></ul>
                  <tbody id='ghLdc'></tbody>

                <tfoot id='ghLdc'></tfoot>

                <legend id='ghLdc'><style id='ghLdc'><dir id='ghLdc'><q id='ghLdc'></q></dir></style></legend>
              • <i id='ghLdc'><tr id='ghLdc'><dt id='ghLdc'><q id='ghLdc'><span id='ghLdc'><b id='ghLdc'><form id='ghLdc'><ins id='ghLdc'></ins><ul id='ghLdc'></ul><sub id='ghLdc'></sub></form><legend id='ghLdc'></legend><bdo id='ghLdc'><pre id='ghLdc'><center id='ghLdc'></center></pre></bdo></b><th id='ghLdc'></th></span></q></dt></tr></i><div id='ghLdc'><tfoot id='ghLdc'></tfoot><dl id='ghLdc'><fieldset id='ghLdc'></fieldset></dl></div>

                <small id='ghLdc'></small><noframes id='ghLdc'>

                  本文介绍了在 Android 上的 kivy 中保存应用数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  假设我正在制作一个健身应用程序,您可以在其中进行锻炼.配置完锻炼后,您会想要保存它.如何添加此功能,以便当他退出应用程序并再次打开应用程序时,他可以查看他的锻炼情况?

                  Say I was making a fitness app where you can make your out workout. When you have configured the workout you would want to save it. How do I add this function so that when he exits the app and opens it again, he can view his workouts?

                  我专门在 Android 上工作.

                  I am working specifically on Android.

                  这可用于保存本地游戏存档和数据.

                  This could be used to save local game saves and data.

                  推荐答案

                  我相信 Kivy 有一个模块可以解决这个问题.虽然它仍然(在撰写本文时)是实验性的.看这里:http://kivy.org/docs/api-kivy.storage.html#module-kivy.storage

                  I believe Kivy has a module that deals with this. Though it is still(at the time of writing) experimental. Look here: http://kivy.org/docs/api-kivy.storage.html#module-kivy.storage

                  根据 this,他们似乎正在使用 Pickle 来存储数据.

                  如果由于某种原因这不起作用,自己使用 Pickle/cPickle 怎么样?如果您不知道这些是什么,请立即使用 Google 搜索.然后您可以将用户设置或锻炼存储在一个字典中并腌制该字典,保存info 作为一个简单的文本文件到 sdcard,它根本不应该占用太多空间.

                  If that doesn't work for some reason, what about using Pickle/cPickle yourself? If you don't know what those are, Google them now. Then you could store user settings or workouts in a dict and pickle that dict, saving the info to the sdcard as a simple text file, which shouldn't take up much space at all.

                  据我所知,cPickle 是一个更快的 Pickle 实现,因为它是用 C 或 Cython 编写的,我不确定.希望这对您有所帮助.

                  As far as I know, cPickle is a faster implementation of Pickle due to being written in C or possibly Cython, I am not sure. Hope any of this helps.

                  值得注意的是,可以将文本文件保存到 Android 设备.我最近使用 Kivy 制作了一个游戏,我就是这样做的,以纯文本形式存储高分.

                  It's worth noting that it's possible to save text files to the Android device. I recently made a game with Kivy where I was doing just that, storing high scores in plain text.

                  这篇关于在 Android 上的 kivy 中保存应用数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Buildozer 编译 apk,但它在 android 上崩溃 下一篇:kivymd 应用程序在 Android 手机上崩溃 ModuleNotFound

                  相关文章

                  最新文章

                1. <tfoot id='TTcis'></tfoot>

                    <i id='TTcis'><tr id='TTcis'><dt id='TTcis'><q id='TTcis'><span id='TTcis'><b id='TTcis'><form id='TTcis'><ins id='TTcis'></ins><ul id='TTcis'></ul><sub id='TTcis'></sub></form><legend id='TTcis'></legend><bdo id='TTcis'><pre id='TTcis'><center id='TTcis'></center></pre></bdo></b><th id='TTcis'></th></span></q></dt></tr></i><div id='TTcis'><tfoot id='TTcis'></tfoot><dl id='TTcis'><fieldset id='TTcis'></fieldset></dl></div>

                      <legend id='TTcis'><style id='TTcis'><dir id='TTcis'><q id='TTcis'></q></dir></style></legend>
                      • <bdo id='TTcis'></bdo><ul id='TTcis'></ul>

                    1. <small id='TTcis'></small><noframes id='TTcis'>