如何将最近2个月的数据存储在本地chache(不在本地数据库中)的日期愿望中
需要将过去七个月的数据存储在本地(不在本地数据库中)。首先我需要先存储 两个月的日期明智的数据在本地。之后,如果数据超过两个月,则需要再次致电 API和存储接下来两个月的当地日期数据,再次持续两个月,最后1个 月份是seveb月份的一个月。 与(2+2+2+1)相同。
这是以下响应:
[
{
"value": 3.0,
"date": "16032022"
},
{
"value": 50.0,
"date": "17032022"
}
]
将数据存储在本地之后,我需要从本地缓存(不是数据库)每周获取数据,这意味着已经通过了一周的开始日期和一周的终点。工作方式应该是什么?
如何在本地和从那里获取每周存储?
Need to store past SEVEN months data in local(not in local database). First I need to store first
TWO months date wise data in local. After that if TWO months data exceeds then again need to call
api and store next TWO months data in local date wise and again for TWO months and lastly for 1
month as it is last SEVEB month data.
Same as (2+2+2+1).
this is the response below:
[
{
"value": 3.0,
"date": "16032022"
},
{
"value": 50.0,
"date": "17032022"
}
]
After storing data in local, I need to get the data from local cache (not database) weekly basis, that means have pass the startDate of week and endDate of week. what should be the way to work?
How to store locally and from fetch there weekly basis?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要将此信息保存在本地缓存中,您可以使用
共享首选项
这可以节省相对较小的键值集合。文档在这里
如何保存数据:
To save this info in local cache you can use
Shared Preferences
this can save relatively small collection of key-values.The documentation Here
Example how save the data: