I have this very specific request that I need to implement. We are
working on an application that lets users attach several different
type of files (pdf, jpg, png, doc, txt, etc). I need to be able to
download the file using Android's default browser.
Here's the problem I have: the URL I get from the server is usually
like this: "https://server

ort/notes/attachment/91" and if I do:
`Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url.toString()));
mContext.startActivity(i);`
Then, after the user authenticates the download seems to start but
gets stuck in 0% and fails. I read that there's a restriction and
Android's browser only downloads files the system recognizes, so I
tried setting the type but then I get an exception:
ERROR/AndroidRuntime(23344):
android.content.ActivityNotFoundException: No Activity found to handle
Intent { act=android.intent.action.VIEW dat=https://server

ort/notes/
attachment/91 typ=image/png }
I'm not sure if this matters but the backend of this app is done in
Ruby on Rails and also I know the name and type of file prior trying
to download the file.
I've already implemented a method for the app to handle the file
download but the client wants to be completely sure there's no other
way.
One more thing, this app should support Android 2.1.
Is there a way I can download this file using Android's file?