0

I have an app that with CountDownTimer that executes a piece of code at the given timeframe.

I have been researching the service and it seems that this may get killed depending on wether android needs more resources and/or if my process gets killed. Furthermore, it seems services run on the Main thread. Wouldn't this affect performance of my app?

My service is also listening for other broadcast and updates codes based on the return on these broadcast.

So what is the best way to move forward to keep this alive for 24 hours and is the Service the right approach.

Beto
  • 806
  • 3
  • 12
  • 33
  • 1
    What sort of work are you performing that requires a service be running for that long? If you simply need to perform some task at a specific time, then I suggest looking into [AlarmManager](https://developer.android.com/reference/android/app/AlarmManager) – CzarMatt Jan 04 '19 at 23:02
  • Can you post your code? – Jonathan JOhx Jan 05 '19 at 02:54
  • I am connected to an external device via bluetooth. This device monitors temperature and needs be ran for 24 hours @CzarMatt – Beto Jan 05 '19 at 03:32

0 Answers0