gpt4 book ai didi

java - SQLite 或数组列表

转载 作者:行者123 更新时间:2023-12-02 04:17:24 27 4
gpt4 key购买 nike

我不确定在我的应用程序中保存数据的最佳方法是什么。它的 map 应用程序,对于每个位置,我想保存某些特征,例如如下所示: enter image description here

  • 我不需要能够在应用程序中编辑数据,它可以具有可读性。
  • 我希望能够搜索每个 ID 是否有特定的属性然后只显示在 map 上。
  • 我还希望能够访问数据用于在 map 上显示
  • 最多约有 400 个 Id。
  • 数据最好以不同类型存储(字符串、整数、小数)。

最好将这些数据保存在 SQLite 等数据库或大型数组列表中,还是有更好的方法?

提前致谢。

最佳答案

SQLite是一个开源 SQL 数据库,它将数据存储到设备上的文本文件中。 Android 内置了 SQLite 数据库实现。

  1. If you have data related with each other, file will not allow you to relate them. At that time SQLite will help you.

  2. If you wan to query your data, store the data in structured manner you will prefer SQLite Than ArrayList

  3. SQLite has higher performance

请阅读这篇文章Why should we use SQLite in Android development?

我的建议

使用Sqlite

关于java - SQLite 或数组列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33169155/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com