title: Periodic task and notifications when the application is closed
body: <p>I have been looking for the best way to execute a periodic task every 30/60 seconds which connects to a web service and show a notification depending on the response. This periodic task should keep on executing even if the application is closed (After Destroy).</p>
  <p>I have seen these options:</p>
  <ul>
  <li><strong>WorkManager:</strong> but the minimum time for this is 15 minutes.</li>
  <li><strong>AlarmManager:</strong> I have read that the resources consumption would be high for my task frequency.</li>
  <li><strong>Foreground Service:</strong> This could be a good option but I don't like the constantly shown notification in this mode.</li>
  </ul>
  <p>Are there any other optimal option to resolve this? Which one do you recommend me?</p>