kk121 / file-loader Goto Github PK
View Code? Open in Web Editor NEWFile downloading library for android.
Home Page: https://android-arsenal.com/details/1/6638
License: MIT License
File downloading library for android.
Home Page: https://android-arsenal.com/details/1/6638
License: MIT License
I tried to download JSON as file to external directory, but when I updated the file, the library didn't check the file integrity
Dose this download blob URL ?
How to the downloaded files when downloading multiple files
i write dependency and syn the project
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.kk121:File-Loader:1.2'
}
Hi,
I'd like to add header, how to do this?
Thanks
java.lang.IndexOutOfBoundsException: Invalid index 9, size is 9 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.krishna.fileloader.MultiFileDownloadTask.onProgressUpdate(MultiFileDownloadTask.java:63) at com.krishna.fileloader.MultiFileDownloadTask.onProgressUpdate(MultiFileDownloadTask.java:20) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:648) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5653) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method)
here is my code
downloader.progressListener(new MultiFileDownloadListener() {
@Override
public void onProgress(File downloadedFile, int progress, int totalFiles) {
try {
FileUtils.copyFile(downloadedFile.getAbsoluteFile(), new File(file, downloadedFile.getName()));
Log.d(TAG, "onProgress() called with: downloadedFile = [" + downloadedFile + "], progress = [" + progress + "], totalFiles = [" + totalFiles + "]");
if (progress == totalFiles) {
isSuccess = true;
isFinished = true;
sendIntent(groupId,false);
}
} catch (IOException e) {
e.printStackTrace();
noOferror++;
if (noOferror == imageArray.length)
isFinished = true;
sendIntent(groupId,false);
}
}
@Override
public void onError(Exception e, int progress) {
super.onError(e, progress);
Log.e(TAG, "onError: ", e);
noOferror++;
if (noOferror >= imageArray.length)
isFinished = true;
sendIntent(groupId,false);
}
}).loadMultiple(imageList.toArray(imageArray));
when i select DIR_EXTERNAL_PRIVATE or DIR_EXTERNAL_PUBLIC it is not created any file directory and not even download any file why this is happen.
multiFileDownloader.cancelLoad();
download continues in the background even though I run the command
Please add a feature of cancel this 1 downloading file.
I just start to add dependencies but error comes up like that, can you help me?
var uris = arrayOf("https://images.pexels.com/photos/45170/kittens-cat-cat-puppy-rush-45170.jpeg", "https://upload.wikimedia.org/wikipedia/commons/3/3c/Enrique_Simonet_-_Marina_veneciana_6MB.jpg", "https://d15shllkswkct0.cloudfront.net/wp-content/blogs.dir/1/files/2017/01/Google-acquires-Fabric.png")
FileLoader.multiFileDownload(this)
.fromDirectory(Environment.DIRECTORY_PICTURES, FileLoader.DIR_EXTERNAL_PUBLIC)
.progressListener(object: MultiFileDownloadListener() {
override fun onProgress(p0: File?, progress: Int, totalFiles: Int) {
println("DownloadFile: $progress | TotalFile $Int" )
}
override fun onError(e: java.lang.Exception?, progress: Int) {
super.onError(e, progress)
println("ErrorOnPrgress: $progress | Error $e" )
}
}).loadMultiple(uris)
After tring this I got error in .loadMultiple(uris), Please help
Hi
How can I have download progress while downloading single file?
Thanks
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at com.krishna.fileloader.request.FileLoadRequest.hashCode(FileLoadRequest.java:2)
at java.util.WeakHashMap.hash(WeakHashMap.java:298)
at java.util.WeakHashMap.getEntry(WeakHashMap.java:426)
at java.util.WeakHashMap.containsKey(WeakHashMap.java:417)
at com.krishna.fileloader.FileLoader.addRequestListenerToQueue(FileLoader.java:4)
at com.krishna.fileloader.request.FileLoadRequest.getRequestListener(FileLoadRequest.java)
at com.krishna.fileloader.builder.FileLoaderBuilder.asFile(FileLoaderBuilder.java:12)
at tamilnadu.school.textbook.BookViewerActivity.onCreate(BookViewerActivity.java:12)
at android.app.Activity.performCreate(Activity.java:7147)
at android.app.Activity.performCreate(Activity.java:7138)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1219)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2885)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3010)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1707)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6759)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:875)
No work with ftp url (eg. ftp://link.com/file.zip
Does this library downloads the file too into the device's internal storage or just shows the file from the network because when I try to open the file using intent it gives error- ERR_FILE_NOT_FOUND.
Below is the code:
`FileLoader.with(mcontext)
.load(message)
.fromDirectory(PRMConstant.FILES_DIRECTORY_NAME, FileLoader.DIR_INTERNAL)
.asFile(new FileRequestListener() {
@OverRide
public void onLoad(FileLoadRequest fileLoadRequest, FileResponse fileResponse) {
....
}
@Override
public void onError(FileLoadRequest fileLoadRequest, Throwable throwable) {
}
});`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.