我怎样才能挽救Android的业务数据? [英] How can I save data from Android service?

查看:143
本文介绍了我怎样才能挽救Android的业务数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有收集数据的服务,我可以保存数据的情况下重新启动或任何其它操作,将重新启动该服务,我该怎么办呢?

解决方案
  

我能保存数据的情况下重新启动或将重新启动该服务的任何其他行动

您不一定会找出何时会发生这些各种事件。保存你的数据,当您去。

  

和我该怎么办呢?

使用的文件。或一个数据库,它是一种类型的文件。或共享preferences 结构,它是由一个类型的文件备份。

I have a service that collects data, can I save the data in case of reboot or any other action that will restart the service, and how can I do it?

解决方案

Can I save the data in case of reboot or any other action that will restart the service

You will not necessarily find out when those sorts of events will occur. Save your data as you go.

And how can I do it?

Use a file. Or a database, which is a type of file. Or a SharedPreferences structure, which is backed by a type of file.

这篇关于我怎样才能挽救Android的业务数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆