public class FileDownloaderAsyncTask extends AsyncTask<String,Integer,Boolean>
AsyncTask.Status
Modifier and Type | Field and Description |
---|---|
private static int |
BLOCK_SIZE |
private String |
directoryPath |
private File |
download_dir |
private boolean |
downloadSuccess |
private String |
fileName |
private long |
fileSize |
private boolean |
isDownloadManagerAvailable |
private boolean |
isDownloadManagerSWADroid |
private Context |
mContext |
private DownloadNotification |
mNotification |
private boolean |
notification |
private static String |
TAG
Downloads tag name for Logcat
|
private URL |
url |
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR
Constructor and Description |
---|
FileDownloaderAsyncTask(Context context,
String fileName,
boolean notification,
long fileSize) |
Modifier and Type | Method and Description |
---|---|
protected Boolean |
doInBackground(String... params) |
private boolean |
downloadFileCustom(String basename,
String extension)
Download method for Android < Gingerbread
|
(package private) File |
getDownloadDir() |
private void |
notifyFailed() |
protected void |
onPostExecute(Boolean result) |
protected void |
onProgressUpdate(Integer... values) |
cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onPreExecute, publishProgress
private static final int BLOCK_SIZE
private final Context mContext
private final DownloadNotification mNotification
private File download_dir
private URL url
private boolean notification
private final long fileSize
private String fileName
private String directoryPath
private boolean downloadSuccess
private final boolean isDownloadManagerAvailable
private boolean isDownloadManagerSWADroid
private static final String TAG
protected void onPostExecute(Boolean result)
onPostExecute
in class AsyncTask<String,Integer,Boolean>
File getDownloadDir()
protected void onProgressUpdate(Integer... values)
onProgressUpdate
in class AsyncTask<String,Integer,Boolean>
private void notifyFailed()
private boolean downloadFileCustom(String basename, String extension)
basename
- filename (without extension) of the file to be downloadedextension
- extension of the file to be downloaded