title: Download data when internet connectivity is detected
body: <p>I want to download some data including json and image(binary data) whenever internet connectivity is available.</p>
  
  <p>I have a full working code which can do that. The problem is I have written that code in custom application class. which downloads it and saves locally.But when app is launched the internet connectivity may not be available at that point of time. </p>
  
  <p>So what I want to do is send the request and download the data whenever internet connectivity is detected and use that data by saving it in content provider locally. And the app will work even without an internet connection. </p>
  
  <p>I am thinking of using broadcast receiver to download the same. But then it will be heavy task for a broadcast receiver to download the data. So now what I am finding out is I can check out internet connectivity in broadcast receiver and I will download the data from some other component. Which is the best practice to do so?</p>
  
  <p>Is broadcast receiver stays around even when application is not on?</p>