How to send data to a REST API every minute from android using kotlin?

175 Views Asked by At

Assuming that I have implemented a SensorEventListener from which I generate the values deriving from the movement of the accelerometer of the device; that I have implemented the visualization in the UI of the heartbeat using the documentation and the example "Measure Data"; that I have already implemented a service that extends the SensorEventListener interface.

I would like to combine these two data into a single request (possibly from the same service) sent every minute to a REST API.

This, however, I can not make it work because every time the screen on the device turns off after less than a few seconds I no longer receive the data in the console from the service with the Listener (I have not yet combined the two data, in fact I am also trying to understand how bring the part of the MeasureClient to the service).

0

There are 0 best solutions below