Downloading data after fix interval in android
<p>i want to Update my database with data that is downloaded from the server. i want to download the data from the server after a fix time interval and update the database without keeping my activities unresponsive . </p>

<pre><code>Handler h = new Handler();
Runnable r = new Runnable() {

        @Override
        public void run() {
            try{
                downloadFromServerAndUpdateDatabase();
            }catch(Exception e){

            }
            h.postDelayed(this,10000);
        }
    };
</code></pre>

<p>But i want to do this when my application is not running. </p>
