Android browser download manager

只谈情不闲聊 提交于 2019-12-23 14:16:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!