问题
Can I use android build-in browser download manager to download files in my application?
In case of audio files, opening remote file url using Intent.ACTION_VIEW with data type "audio/*" causes browser to start playback, but I'd like to force download of specified file.
回答1:
http://developer.android.com/reference/android/app/DownloadManager.html
Can some one tell what is this? If download Manager isnt a part of SDK.
Seems to me like a complete download manager. I will try this soon.
回答2:
The download manager is not part of the public SDK. You are welcome to download files from URLs via HttpURLConnection or HttpClient, both part of the Android SDK.
回答3:
I am wondering exactly the same. It seems like a waste of time to write a service which handles download/resume/checking connection etc, when I just want to say downloadFile(URL myURL). Is there anything that could be re-used? Android Market also has a downloader...
来源:https://stackoverflow.com/questions/1779565/android-browser-download-manager