In the MainActivity my APP has a button to open a Google Maps activity and show you some coordinates that you receive from a Raspberry Pi. The problem is that I do not know how to make the coordinates update while the app is still working.
That is, make an independent process that updates the coordinates every X minutes. I've tried with a
Service
but it does not work because the service does it once and I have to call it again, and if I put a loop inside the Service, the APP stops because the Service is running and ignores the OnClickListener of the MainActivity.
What can I use to keep the APP waiting with the setOnCLickListener
for example to open the Maps and in the meantime update the coordinates of the raspberry with a certain period of time?
Are those threads? Subprocesses? I have no idea what I can use.
I do not know if I have explained myself well, ask me if you have not understood something, I will answer as soon as possible. Thank you very much.