views:

113

answers:

1

What is the best way to download an mp3 file in java (on Android sdk)? http://developer.android.com/reference/java/net/package-summary.html

Should I be using sockets? If so - what kind of "Stream" reader should I use? I have also read something about "intents" - is this something that is applicable here?

I am also curious as to what should one do if connection gets interrupted - can I resume the download somehow or restart it?

Any tips?

A: 

WHat protocol does the server support?

If it's HTTP, you should use HttpURLConnection. If server supports it, you can use the Range header to resume the downloading.

ZZ Coder
The server supports HTTP. Basically it's for downloading mp3's from podcasts.
drozzy