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?
Android Services have a lifecycle like its Activities. Refer to the documentation for proper callbacks to save state before a service is shutdown.
Might I recommend the onDestroy() method.