管理 Android AR 应用数据的最佳方法是什么?
我正在为我的学校开发增强现实应用程序,其中有两种类型的兴趣点(POI):
第一个是我提供的,因此,它们将始终保留 相同。大约有 200 个这样的人,连同他们的 jpg 或 png 图像。
用户可以添加他们希望与其他用户共享的 POI。所以 我不知道可以预期有多少个 POI。
我已经在远程服务器上设置了一个 MySQL 数据库,可以保存所有提到的 POI。 对于给定场景,以下哪个选项最适合管理 Android 应用程序中的数据?
- 从远程数据库获取所有内容并且不存储任何内容。 在应用程序中,使用数据库以外的某些数据结构。
- 从远程数据库获取所有内容并将其存储在 SQLite 数据库中 使用时,并在关闭应用程序时将其删除。
- 只获取那一刻将要显示的信息, 尽管这意味着对远程数据库的大量请求。
- 在应用程序中设置一个 SQLite 数据库来保存由以下提供的 POI 我(大约200)并离线初始化它(使用所有数据 已经在脚本中)第一次运行应用程序时。
- 与4相同,但第一次从服务器获取数据。
- 与 4 和 5 相同,但仅存储数据,不存储相关图像 到每个 POI。
如果您有更好的选择,请提出! 最好使应用程序尽可能轻量,并尽可能避免向 remo DB 发送不需要的请求。
I'm developing and Augmented Reality app for my school where there will be two types of points of interest(POI):
The first ones are provided by me, and hence, they will remain always
the same. There will be circa 200 of these ones, together with their
jpg or png images.Users could add POI's they wish to share with other users. Therefore
I cannot know how many POI's can I expect.
I have set up a MySQL DB on a remote server that can keep all the mentioned POI's.
Which of these options will be best for managing the data in the android app for the given scenario?
- Fetch everything from the remote DB and don't store anything.
While in the app, use some data structure other than a DB. - Fetch everything from the remote DB and store it in an SQLite DB
while it is used, and remove it when closing the app. - Fetch just the info that is going to be displayed in that moment,
although this would imply lots of requests to the remote DB. - Set up a SQLite DB in the app that holds the POI's provided by
me(arround 200) and initialize it off-line (with all the data
already on a script) the first time you run the app. - Same as 4 but fetching the data from the server the first time.
- Same as 4 and 5 but storing just the data, not the image related
to each POI.
If some you come up with a better option propose it please!
It would be good to make the app as light as possible and avoid as many not needed requests to the remo DB as possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将它们分成小簇:
与放大 Google 地图类似地思考。如果您距离较远,它会显示所有内容的缩小图片,但当您放大时,您会看到更多细节。通过这种方法,您也许可以在用户环顾四周时拥有 POI 集群。如果它们在一个地方停止一段时间,您可以让它开始加载该集群中的值。通过发送用户位置和方向作为查询,在服务器上计算这一切。
考虑让用户保存加载的 POI。这样您就不会保存从服务器下载的所有内容。
Try putting them in little clusters:
Think similarly to Zooming in on Google Maps. If your far away it shows a zoomed out picture of everything, but as you zoom in you get more detail. With this method you can perhaps have POI clusters, while the user is looking around. If they stop in one place for a while you can have it begin loading the values in that cluster. Calculating this all on the server by sending the users location and direction as a query.
Consider letting the user save POI that get loaded. This way your not saving everything you have downloaded from the server.