The second example may run faster, but it monopolizes the GUI thread. The first approach, using AsyncTask, is better; it allows the GUI to stay responsive as the download proceeds.
I found it helpful to compare AsyncTask with SwingWorker, as shown in this example.