 <pre><code>first method </code></pre> <p>you can create an AsynTask .. Your code should run in background in order to be responsive.. otherwise it will show Not Responding ..</p> <pre><code>Second Method </code></pre> <p>You can create a seperate thread for it .. using multitasking.</p> <pre><code>Third </code></pre> <p>Right the code in the <code>onCreate</code> after <code>setContentView</code></p> <pre><code> StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); </code></pre>