issue in Download file
<p>i have develop applicatin in which i need to download file from url and i have tried following code but i got 0 byte when i shown detail. </p>

<p><strong>Code::</strong> </p>

<pre><code>package com.playmusic;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;


public class playmusic extends Activity {

 private static String fileName = "shanesh.mp3";

 @Override
 public void onCreate(Bundle savedInstanceState) 
 {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    try {
        URL url = new URL("URl");
        HttpURLConnection c = (HttpURLConnection) url.openConnection();
        c.setRequestMethod("GET");
        c.setDoOutput(true);
        c.connect();

        String PATH = Environment.getExternalStorageDirectory()
                + "/download/";
        Log.v("log_tag", "PATH: " + PATH);
        File file = new File(PATH);
        file.mkdirs();
        File outputFile = new File(file, fileName);
        FileOutputStream fos = new FileOutputStream(outputFile);

        InputStream is = c.getInputStream();

        byte[] buffer = new byte[1024];
        int len1 = 0;
        while ((len1 = is.read(buffer)) != -1) {
            fos.write(buffer, 0, len1);
        }
        fos.close();
        is.close();
    } catch (IOException e) {
        Log.d("log_tag", "Error: " + e);
    }
    Log.v("log_tag", "Check: ");
} }
</code></pre>

<p><strong>Manifest :</strong> </p>

<pre><code>&lt;uses-permission android:name="android.permission.INTERNET"&gt;&lt;/uses-permission&gt;
&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"&gt;&lt;/uses-permission&gt;
&lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"&gt;&lt;/uses-permission&gt;
&lt;uses-permission android:name="android.permission.READ_PHONE_STATE"&gt;&lt;/uses-permission&gt;
</code></pre>
