How do I download a file via default Android Downloader?

android, android-2.2-froyo, debugging, download, file

Solution

You need to use `HttpUrlConnection` to do this on Android 2.2 and below. There is a very detailed tutorial on the internet that shows you how to do this (with a progress dialog box too).

Remember you must use an `AsyncTask` or a `Thread` to ensure that you do not block the UI thread during the actual download!

Problem

How can I download files using Android downloader? (The downloader that WebBrowser is using that too). I tried something like this : ``` Intent i = new Intent(Intent.ACTION_VIEW , Uri.parse("MyUrl")); startActivity(i); ``` Any better way? Edit I am using Android 2.2

Original source

Related problems