为什么要使用SQLite数据库在Android的?要使、数据库、SQLite、Android

2023-09-12 09:24:31 作者:落寞繁花,独我一人赏

为什么我们使用android.I SQLite的数据的基础上正在开发一个Android应用程序,其中的数据将被从服务器中提取,并做一些数据的计算,并显示在用户界面。

Why do we use the sqlite data base in android.I am developing an android application where the data is to be fetched from the server and do some data calculation and show it on the UI.

这是好对我来说,将数据提取到的SQLite数据库,并从埃夫里20分钟sqlite的更新固定间隔的UI还是会好发送的HTTP GET请求到服务器和更新来自TEH数据响应的用户界面。

Is it good for me to fetch the data into the sqlite DB and update the UI on regular interval from the sqlite in evry 20 minutes or will it be good to sent the Http get request to the server and update the data from teh response on the UI.

我想知道哪一个会更好,为什么?为什么涉及到的SQLite数据库? 该数据对应于一些繁重的数学处理是必须要做的,然后显示在用户界面(类似于股市中的应用),需要的数据每12小时后,被清除的一些40X40表中的数据。 PLZ建议 RGDS, 劳尔

I wanted to know which one will be better and why?Why to involve sqlite DB? The data corresponds to some 40X40 table data on which some heavy mathematical processing is to be done and then displayed on the UI(similar to Stock market application) and data needs to be cleared after every 12 hours. plz advice Rgds, Raul

推荐答案

这是好事,你的情况使用的数据库。

It is good to use database in your case.

优点:

如果您的应用程序被关闭内存中的数据会丢失,但在那之后,你就可以从数据库中,如果你有一个恢复状态 特别是对复杂计算的情况下,这是好事,一旦在数据库中多次存储结果,而不是重新计算按需 在该数据库将解开你的用户界面的网络连接,因此您将能够显示的结果,即使没有互联网连接 使用数据库,你将能够从一个后台服务获取更新的数据,而不会影响你的UI 在组织数据在数据库中通常使人们更方便地管理所有应用程序数据。

缺点:

添加数据库将需要一些额外的努力,就在你身边

正如你可以看到我的名单证明,你应该在你的情况下使用的数据库。也许我有偏见,但至少我为你提供需要考虑的事情。

As you can see my list proves you SHOULD use database in your case. Maybe I am biased, but at least I provide you with things to consider.