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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With