开发者

Downloading mp3 files in java on Android [closed]

开发者 https://www.devze.com 2022-12-29 08:44 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_StackOverflow
Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_StackOverflow

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 8 years ago.

Improve this question

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消