title: How to schedule a task in android which will run on immediately after internet is available and reschedule it if fails?
body: <p>Need scheduler to</p>
  
  <ul>
  <li><code>Run task immediately after net is available</code></li>
  <li><code>Reschedule task if it fails because of some problems.</code></li>
  <li><code>should handle cases of broadcast receiver to know if connection available</code></li>
  <li><code>No delay in execution if the internet is already available not like GCMNetworkManager's OneOfTask which take at least 30 seconds to execute the scheduled task</code></li>
  </ul>
  
  <p>I tried <a href="https://developers.google.com/android/reference/com/google/android/gms/gcm/OneoffTask" rel="nofollow noreferrer">GCM Network Manager's OneOfTask</a> which handles it but takes at least 30 seconds to execute even if the internet is available.</p>
  
  <p>Is there any other scheduler which will all above task in one.</p>