All Projects → lyrebirdstudio → Filebox

lyrebirdstudio / Filebox

Async file downloader for Android

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Filebox

Downloader
Powerful and flexible Android file downloader
Stars: ✭ 193 (-34.13%)
Mutual labels:  downloader, file
Aria
下载可以很简单
Stars: ✭ 4,777 (+1530.38%)
Mutual labels:  downloader, file
Write
Write data to the file system, creating any intermediate directories if they don't already exist. Used by flat-cache and many others!
Stars: ✭ 68 (-76.79%)
Mutual labels:  async, file
Github Files Fetcher
Download a specific folder or file from a GitHub repo through command line
Stars: ✭ 73 (-75.09%)
Mutual labels:  downloader, file
util
封装了一些Java常用的功能
Stars: ✭ 19 (-93.52%)
Mutual labels:  downloader, file
Whatsapp Bot
Whatsapp Bot - Node Js.
Stars: ✭ 271 (-7.51%)
Mutual labels:  downloader
React Loadable
⏳ A higher order component for loading components with promises.
Stars: ✭ 16,238 (+5441.98%)
Mutual labels:  async
Udemy Dl
Nodejs script to download a udemy.com course, for personal offline use
Stars: ✭ 271 (-7.51%)
Mutual labels:  downloader
Twitchio
TwitchIO - An Async Bot/API wrapper for Twitch made in Python.
Stars: ✭ 268 (-8.53%)
Mutual labels:  async
Gofi
Gofi (gəʊfi:) means Go file indexer.
Stars: ✭ 291 (-0.68%)
Mutual labels:  file
Flock
Thread-safe file locking library in Go (originally github.com/theckman/go-flock)
Stars: ✭ 288 (-1.71%)
Mutual labels:  file
Phpvideos
php 写的视频下载工具,现已支持:Youku、Miaopai、腾讯、XVideos、Pornhub、91porn、微博酷燃、bilibili、今日头条、芒果TV
Stars: ✭ 281 (-4.1%)
Mutual labels:  downloader
Chrome Avgle Helper
👏 A Chrome extension for Avgle and other interesting video sites. Downloader inside
Stars: ✭ 276 (-5.8%)
Mutual labels:  downloader
Androiddownloader
An powerful download library for Android.
Stars: ✭ 287 (-2.05%)
Mutual labels:  downloader
Example Scalping
A working example algorithm for scalping strategy trading multiple stocks concurrently using python asyncio
Stars: ✭ 267 (-8.87%)
Mutual labels:  async
Ant
A lightweight, feature-rich, easy-to-use and nice-looking BitTorrent Client developed by golang, angular 7, and electron.
Stars: ✭ 292 (-0.34%)
Mutual labels:  downloader
Irs
🎸 🎶 A music downloader that understands your metadata needs.
Stars: ✭ 268 (-8.53%)
Mutual labels:  downloader
Exploring Async
An essay exploring different async techniques in JavaScript.
Stars: ✭ 280 (-4.44%)
Mutual labels:  async
Douyin downloader
👏Download all douyin videos of user(including favorites) , 下载指定用户的所有抖音视频以及收藏的视频(无水印)
Stars: ✭ 288 (-1.71%)
Mutual labels:  downloader
Lynda Dl
A cross-platform python based utility to download courses from lynda.com for personal offline use.
Stars: ✭ 280 (-4.44%)
Mutual labels:  downloader

What is FileBox

FileBox is an async file downloader library for Android.

Before we develop filebox, we though that URL content changes very rarely. So basically this library downloads a given URL, and if it is already downloaded, it provides downloaded content directly.

FileBox;

  • Shares ongoing download requests to the observers. So It reduces Data Usage.
  • Has TTL(Time To Live) duration. Filebox re-download the URL if TTL is expired.
  • Supports both Cache and External directory.
  • Supports the File Encryption for sensitive URL(images, videos, any file).
  • Allows you to create a custom folder destination.
  • Clears unreliable data automagically.
  • Does Etag Check. Filebox doesn't download the file again If the file's TLL(Time To Live) is up but the file has not changed.
  • Supports Multiple Download. If you have N file and want to get notified when all completed.
  • Runs on application scope. There is no pause/resume continuation support.

Flow Diagram

Modules

Basic Usage

val fileBoxRequest = FileBoxRequest("https://url1.png")

val filebox= FileBoxProvider.newInstance(applicationContext, FileBoxConfig.createDefault())

filebox.get(fileBoxRequest)
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe { fileBoxResponse ->
        when (fileBoxResponse) {
            is FileBoxResponse.Downloading -> {
                val progress: Float = fileBoxResponse.progress
                val ongoingRecord: Record = fileBoxResponse.record
            }
            is FileBoxResponse.Complete -> {
                val savedRecord: Record = fileBoxResponse.record
                val savedPath = fileBoxResponse.record.getReadableFilePath()
            }
            is FileBoxResponse.Error -> {
                val savedRecord: Record = fileBoxResponse.record
                val error = fileBoxResponse.throwable
            }
        }
    }

Customize Config

val fileBoxConfig = FileBoxConfig.FileBoxConfigBuilder()
        .setCryptoType(CryptoType.CONCEAL) // Default is CryptoType.NONE
        .setTTLInMillis(TimeUnit.DAYS.toMillis(7)) // Default is 7 Days
        .setDirectory(DirectoryType.CACHE) // Default is External
        .setFolderName("MyPhotos") // Default is none
        .build()

Multiple Download Request

val fileBoxMultipleRequest = FileBoxMultiRequest(
            arrayListOf(
                FileBoxRequest("https://url1.png"),
                FileBoxRequest("https://url2.zip"),
                FileBoxRequest("https://url3.json"),
                FileBoxRequest("https://url4.mp4")
            )
        )

val filebox = FileBoxProvider.newInstance(applicationContext, FileBoxConfig.createDefault())

filebox.get(fileBoxMultipleRequest)
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe { fileBoxResponse ->
        when (fileBoxResponse) {
            is FileBoxMultiResponse.Downloading -> {
                val progress = fileBoxResponse.progress
                val ongoingFileResponseList = fileBoxResponse.fileBoxResponseList
            }
            is FileBoxMultiResponse.Complete -> {
                val ongoingFileResponseList = fileBoxResponse.fileBoxResponseList
                ongoingFileResponseList.forEach { it.record.getReadableFilePath() }
            }
            is FileBoxMultiResponse.Error -> {
                val error = fileBoxResponse.throwable
                val ongoingFileResponseList = fileBoxResponse.fileBoxResponseList
            }
        }
    }

Destroy

Don't forget to destroy the filebox when your initialized scope is destroyed. If you create a filebox in your application class, It is application scoped. If you create a filebox in your activity class, It is activity scoped. Be aware of your lifecycle.

filebox.destroy()

Setup

allprojects {
     repositories {
	...
	maven { url 'https://jitpack.io' }
     }
}
dependencies {
      implementation 'com.github.lyrebirdstudio:filebox:0.1'
}

License

Copyright 2020 Lyrebird Studio.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].