Hey Android Builder Community, Today I am going to present you a Download Extension with very advanced features.
Features:
- You can download any file from it.
- It uses TinyDB to store the file details and you can resume the download anytime you want, Even after closing the application. You can easily resume download by its download id.
- It always resumes download, also in any error like download failed, network error, link expired, etc. ( In case of link expiration you have to use a different link of the same filename )
- NOTE that if 2 files have the same name then the file may get corrupted.
- You can also set the Net pack usage limit by this extension, In bytes, and when the download limit exceeds if Pause On Net Usage is enabled then it will automatically pause all downloading
- You can also download multiple files by using this extension.
- Global download will help you to get all files downloading process and downloaded process by which you can create a single progress bar for all downloading files.
- It also has some other features like time conversion bytes conversion to a human-readable format, and ms to human-readable time, You can also get URL headers in this extension.
Here is the block description and usage
- This is Download init event which will be executed when downloading initialize means it will run before downloading a file. It will provide you with downloadId, FileName, FilePath, FileSize
- When the file is downloading this event will execute, Where you will get totalDownloaded in bytes, fileSize in bytes, speed in bytes, fileName, downloadId, downloadingLink which you can use as you want, You can use ConvertBytes to convert the given data to a human-readable format
- This Event will execute when you got any error, While downloading the file or doing other stuff with this extension, Here you will get the error parameter in the text format
- This event will execute when downloading is completed successfully, It will return downloadId as a unique identifier.
- This event will execute when any file is downloading and also to use this event you must have to enable Global Download, It will return totalDownloaded in the form of bytes and downloading current downloaded bytes which you can convert with ConvertBytes block, Note that it will combine the all downloaded bytes and currently downloaded bytes together.
- This event will be executed when Downloading gets paused, It will return downloadId of the current downloading file.
- This event will be executed when the download gets resumed. It will return a downloadId as a unique identifier for downloading the file.
- This event will execute when the net pack limit is equal to or greater than the download limit set ( NOTE you must have to turn Net Usage Limit Enable to true and also recommended to set **Pause On Net Usage ** to enable too ), It will return downloadId as a unique identifier of a downloading file.
- This Event will execute when you are resuming or downloading the file that is already downloaded.
- This event will run when you use the GetHeader block, It will return jsonData where you will get all the headers of the given URL.
- This event will execute when you use the GetFileDetails block, which will return the JSON data which contains some fine details like file name, file size and file mimeType
- This block will help you to get downloaded or downloading Ids you can also get download ids even after completely closing the application or it is useful when you want to resume the download ( You can also use the same download link to resume download with download block )
- This block will help you to get FileName by download id, NOTE You can only use this block if downloading is started or resumed but if you use it in When Download Init then it won’t work if downloading is not resumed.
- This block will help you to get file path by downloading ID, Same condition is applied as FileNameByID ( NOTE You will only get file path without file name )
- This block will help you to get downloading link by downloadId cause you wanted to store or show it to the user, Same condition is applied as FileNameByID
- This block will help you to get the file size by using the download id in bytes, Same condition is applied as FileNameByID
- This block will help you to get the progress or total downloadedBytes by download id in bytes, the Same condition is applied as FileNameByID
- This block will help you to resume downloading by using download ID
- This block will help you to download the file, You must have to provide the downloading URL and path to start downloading, ( NOTE: Do not pass the file name in the file path only pass that path where you wanted to download the file, the Custom file name is not supported yet )
- This block will help you to pause downloading by giving Download ID
- This block will help you to cancel the downloading process by download id and also it will delete the file too.
- This block will help you to clear all data saved in DB ( Not recommended to use only use in case of any error in DB )
- This block will help you to get a header from the given URL it will execute the GotHeader event (Sometimes you have some details only available on headers here you can get it, It makes a head request so if you are using your server then make sure to set head request enable )
- This block will help you to generate dummy data of a given path, ( In case some file is downloaded and not showing on the database you can use this to add the file to the database, Note you won’t be able to resume that file with download id you have to use different download link which contains same file name to resume the downloading )
- This block will help you to convert bytes to human-readable formats like kb, MB, GB, TB, etc.
- This block will help you to generate a random string of a specific length ( Note don’t use very big length it may crash your application you can use 500 or 1000 words but don’t use very big )
- This block will help you to convert ms to human readable time only in the form of min and sec
- This block will help you to Convert time to a human-readable time by a specific format e.g.
time is2018-09-10 22:01:00
format isyyyy-MM-dd HH:mm:ss
Output:Tue Sep 11 03:31:00 GTM +05:30 2018
- This block will help you to get the file details by URL details like Name, MimeType, and Size, It will execute the GotFileDetails event
- This block will help you to reset your internet usage limit in case the limit exceeds.
- Get refresh time. What is refresh time?
Well refresh time is a time in which you will be able to see the downloading in OnDownloading means the gap between downloading ( NOTE: Don’t set it too high it will not affect downloading but it will slow down the process of getting progress, And also don’t make it too less else it could crash your application 1 to 5 sec recommended )
- This block will help you to set refresh time.
- Return true if Net Usage Limit is enabled else false
- Set net usage limit to enable or disable
- Get usage limit in Bytes
- Set net usage limit in bytes
- Return true if pause on net usage is enabled else false
- Set pause to enable or disable when monitoring net usage is enabled.
- If GlobalDownload is enabled then it returns true else false.
- Set global downloading enable or disable, If enable then it will execute the OnGlobalDownloading event.
NOTE: Make sure to read all the docs carefully to use this, if you found any error or bug then must contact the comment down below or dm me
DOWNLOAD LINK:
com.download.maiis.downloader.aix (101.7 KB)