public class DownloadFactory extends Object
Constructor and Description |
---|
DownloadFactory() |
Modifier and Type | Method and Description |
---|---|
static boolean |
downloadFile(Context context,
String url,
String fileName,
String title,
String description)
Download method for Android >= Gingerbread
|
static String |
humanReadableByteCount(long bytes,
boolean si)
Method to show file size in bytes in a human readable way
http://stackoverflow.com/questions/3758606/how-to-convert-byte-size-into-human-readable-format-in-java
|
static boolean |
isDownloadManagerAvailable(Context context) |
public static boolean downloadFile(Context context, String url, String fileName, String title, String description)
url
- URL of the file to be downloadedfileName
- filename of the file to be downloadedtitle
- title of the download notificationdescription
- description of the download notificationpublic static boolean isDownloadManagerAvailable(Context context)
context
- used to check the device version and DownloadManager informationpublic static String humanReadableByteCount(long bytes, boolean si)