Nothing specific to Android. Do it how you do in Java.
// Create a URL for the desired file
URL url = new URL(URL_LOCATION);
// Open an InputStream to read the resource
InputStream is = url.openStream();
// Use this InputStream to read your file
Here is how you can use this InputStream
to save the file on sd card by using OutputStream
.
try {
File root = Environment.getExternalStorageDirectory();
String localFilePath = root.getPath() + "/yourFileName";
FileOutputStream fos = new FileOutputStream(localFilePath, false);
OutputStream os = new BufferedOutputStream(fos);
byte[] buffer = new byte[1024];
int byteRead = 0;
while ((byteRead = is.read(buffer)) != -1) {
os.write(buffer, 0, byteRead);
}
fos.close();
} catch (Exception e) {
e.printStackTrace();
}