反应本地数据库

发布于 2025-02-07 15:53:01 字数 512 浏览 3 评论 0原文

好的...我很困惑。我是React Native的新手,并且创建了一个简单的移动应用程序,该应用显示了新闻列表(包含特定图像,标题和描述)。我在编程中有很多经验来自游戏开发。我创建了许多游戏,我对您更新和检索数据的云存储系统很熟悉。

现在,我只有一个本地的JSON文件,上面有一系列“新闻”对象,然后循环浏览此数组以显示新闻帖子。基本上,我想将此JSON文件移至该应用程序只是检索它的在线某个地方。这样可以编辑新闻JSON文件以更改,添加或删除新闻。因此,我不需要帐户或任何内容。我什至不需要能够从应用程序设置/更新数据。我只需要一个可以存储可以从应用程序检索的图像和文件的地方。

我尝试使用常见的反应本机数据库系统,例如SQLite,Realm,MongoDB和Firebase,但由于它们没有意义而不得理解它们的工作方式。另外,在制作移动应用时,所有这些服务似乎都要求您设置后端并启动服务器,从我可以看出的情况下,这在移动设备上不起作用...逻辑上会有一个全局数据我可以将存储存储的基础,然后通过简单的获取或网络调用接收。我在这里完全疯了吗?:)任何帮助或指导都非常感谢。谢谢。

Ok... I am so confused. I am new to React Native and I have created a simple mobile app that shows a list of news (containing a specific image, title, and description). I have a lot of experience with programming most of which comes from game development. I have created many games and I am familiar to cloud storage systems that you update and retrieve data.

Right now I just have a local json file with an array of 'news' Objects and then I loop through this array to show the news posts. Basically, I want to move this json file to somewhere online where the app just retrieves it. This would make it so that the News json file could be edited in order to change, add or remove new news. So, I don't need account or anything. I don't even need to be able to set/update data from the app. I just need a place to store images and files that can be retrieved from the app.

I have tried using the common react native data base systems like sqlite, realm, mongodb, and firebase, but must not understand how they work because they make no sense. Also, it seems like when making a mobile app all of these services require you to setup a backend and start a server, which from what I can tell doesn't work on mobile... It seems logical that there would be a global data base that I could store storage on and just receive it by a simple fetch or network call. Am I totally crazy here ?:) Any help or guidance is super appreciated. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文