Yes, I think MediaTracker wouldn’t work with all files?
How about using URLConnection? With a thread, you can easy load data from the net and store it in a file + track progress. Something similar to:
// where to store the data
OutputStream out = new FileOutputStream(localFilePath);
// where the file is located we want to download
URLConnection urlConnection = new URL(remoteFileURL).openConnection();
InputStream in = urlConnection.getInputStream();
// globals
totalSize = urlConnection.getContentLength();
currentSize = 0;
byte buffer[1024];
boolean finished = false;
while (!finished) {
int size = in.read(buffer);
if (size == -1) {
finished = true;
}
else {
out.write(buffer, 0, size);
currentSize += size;
}
}
It won’t compile. There is also some stuff missing. However, that’s what I basically use. With the class variables “currentSize”/“totalSize” you can track the download progress from a separate class. I can send you my “FileDownloader” class if you are interested…