Running a repeating task in background on a real time application
问题 I'm writing an application which is continuously listening and checking the sensors (almost all available) and saving that data into the database in the device. I need to make some calculations every X second with that data and throw a new event if the calculations check says so. I'm thinking about requesting to have the device plugged in while using the application (regarding battery drain). What's the best approach for the task that needs to make the calculations and throw the event? Timer?