Android DownloadManager Progress

I am looking for a better way of doing this also, but so far I am planning to just poll for progress every 1sec or so. DownloadManager mgr = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); long id = mgr.enqueue(request); DownloadManager.Query q = new DownloadManager.Query(); q.setFilterById(id); Cursor cursor = mgr.query(q); cursor.moveToFirst(); int bytes_downloaded = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)); cursor.close(); Edit: A FileObserver can … Read more

What’s a .sh file?

What is a file with extension .sh? It is a Bourne shell script. They are used in many variations of UNIX-like operating systems. They have no “language” and are interpreted by your shell (interpreter of terminal commands) or if the first line is in the form #!/path/to/interpreter they will use that particular interpreter. Your file … Read more