views:

1392

answers:

4

Hello, I was wondering what is the intent for downloading URLs? In the browser, it will download stuff with a little notification icon. I was wondering if I can use that intent (and what it is). Thanks, Isaac Waller

+1  A: 

Have a look here at all the Android Intents.

GregD
That is good but there is no one that starts a download (maybe the browser one, I will try that). Thanks anyway.
Isaac Waller
No, the browser one does not work - thanks anyway. I may have to do it manually.
Isaac Waller
+2  A: 

What are you trying to do? If your app wants to download a file you can use the UrlConnection code. If you want to download a package then ACTION_PACKAGE_INSTALL should do what you want.

hacken
I know, but the browser has a download - notification - thingy and I thought if it was a public intent I could just use it instead. I guess I will have to do it manually. Thanks, Isaac
Isaac Waller
A: 

I have the same problem.I want to get the intent with the url and file name to download,but i don't known the intent and how to receive .

yishoulong
+2  A: 

While I don't believe there is a download Intent in the browser, you can probably use a normal ACTION_VIEW Intent and have the browser decide if it should download or view the url based on the content-type.

So from your code trigger new Intent(Intent.ACTION_VIEW, Uri.parse(url))

and hope this triggers a download in the browser.

dparnas
yep, that's how you can do it.
Juri