tanodxyz / gdownload Goto Github PK
View Code? Open in Web Editor NEWLight Weight, Fast ๐ , Easy to Use, Reliable Download client for android.
License: Apache License 2.0
Light Weight, Fast ๐ , Easy to Use, Reliable Download client for android.
License: Apache License 2.0
Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.-------/com.xyz.ui.main.MainActivity}: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@35b614f rejected from java.util.concurrent.ThreadPoolExecutor@7a8b0dc[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5301)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5330)
at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:181)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:102)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2235)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:240)
at android.app.ActivityThread.main(ActivityThread.java:7829)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
Caused by java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@35b614f rejected from java.util.concurrent.ThreadPoolExecutor@7a8b0dc[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at com.tanodxyz.gdownload.executors.BackgroundExecutorImpl.execute(BackgroundExecutorImpl.kt:11)
at com.tanodxyz.gdownload.GDownload.runOnBackground(GDownload.kt:184)
at com.tanodxyz.gdownload.GDownload.onDestroy(GDownload.kt:145)
at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged(FullLifecycleObserverAdapter.java:51)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
at androidx.lifecycle.LifecycleRegistry.backwardPass(LifecycleRegistry.java:290)
at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:308)
at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:151)
at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:134)
at androidx.lifecycle.ReportFragment.dispatch(ReportFragment.java:68)
at androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPreDestroyed(ReportFragment.java:224)
at android.app.Activity.dispatchActivityPreDestroyed(Activity.java:1436)
at android.app.Activity.performDestroy(Activity.java:8254)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1341)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5286)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5330)
at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:181)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:102)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2235)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:240)
at android.app.ActivityThread.main(ActivityThread.java:7829)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:512)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
**Crashlytics**
Or Maybe preserve the interface to custom to support upload data.....
BTW, I don't know if support the okhttp3 as the underlying connection handler ...
Hello, is there a document explaining how we can use this library in Java?
Group downlaod lifecycle destroy on activity destroy, is there a way to make it like service or worker?
hello,
i can't cancel single download file, can you please help
Currently we are using URLConnection
from java.net
and this should be removed and more abstract approach should be taken while making connection in RemoteConnection
class.
///todos
var connection: URLConnection
this field from RemoteConnection
RemoteConnection
open to inheritance.Exception android.net.ConnectivityManager$TooManyRequestsException:
at android.net.ConnectivityManager.convertServiceException (ConnectivityManager.java:4034)
at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:4226)
at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:4233)
at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4615)
at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4585)
at com.tanodxyz.gdownload.NetworkInfoProvider. (NetworkInfoProvider.kt:51)
at android.view.View.performClick (View.java:7892)
at android.view.View.performClickInternal (View.java:7869)
at android.view.View.-$$Nest$mperformClickInternal
at android.view.View$PerformClick.run (View.java:30880)
at android.os.Handler.handleCallback (Handler.java:942)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:226)
at android.os.Looper.loop (Looper.java:313)
at android.app.ActivityThread.main (ActivityThread.java:8757)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
i see this on firebase crash analytics , can you please how to avoid it.
my code is:
DownloadManager.Builder(App.INCTANCE) .setNetworkInfoProvider(NetworkInfoProvider(App.INCTANCE)) .setDataReadWriteWorkersManager(DataReadWriteWorkersManagerImpl()) .setCallbacksHandler(runCallbacksOnMainThread = true) .setStorageHelper(DefaultFileStorageHelper(App.INCTANCE)) .setConnectionManager(ConnectionManagerImpl(URLConnectionFactory(), executor)) .setScheduledBackgroundExecutor(executor) .build()
if you are downloading in fragment you may close it and come back again, so i need to get the group of downloading to cancel if the user want to
While using group downloader, is there any function that "pauses" current download and "resumes" some of the downloads using it's id?
For example, while downloading large files, the user may want to pause some, just by resuming another. Let's say I have 5 downloads in list, the 2nd is downloading, but for the moment I want to prioritize the 3rd. Then I press resume on 3rd, that "pauses" (and not freezes) the 2nd, making the 3rd a priority.
private fun createGroupDownloader(callback: (Group) -> Unit) {
GDownload.freeGroup(context) {
concurrentDownloadsRunningCapacity = 1 // maximum number of parallel downloads running...
groupLoopTimeMilliSecs = 2_000
maxConnectionPerDownload = 32 // max number of connection per download...
progressCallbacksOnMainThread = true
val group = getGroup()
group?.let(callback)
}
}
hello,
i'm trying to download json file but there are error:
get file length isn't true
downloaded file corrupted
here is a link for download file example
https://files.goldenquran.org/quraan_tafser/11_v5.json
please also if there a chance i need direct connection with you
Based on priorities Group Downloads will Run.
Support for Custom Id's (feasibility test)
Minor improvements in Group Download progress Callbacks.
issue .
hello,
how can i get the list of group download?
Using KT, how to manually set the Threads amout to the downloader?
I am implementing in a case that it will be usefull.
hello,
i have the issue below even i initialized the library on mainactivity, this happens after 1 hour of being application in background, the application is single task
E FATAL EXCEPTION: main
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@6bac32c rejected from java.util.concurrent.ThreadPoolExecutor@504b1f5[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at com.tanodxyz.gdownload.executors.BackgroundExecutorImpl.execute(BackgroundExecutorImpl.kt:10)
at com.tanodxyz.gdownload.GDownload.runOnBackground(GDownload.kt:184)
at com.tanodxyz.gdownload.GDownload.getFreeDownloaderOrCreateNewOne(GDownload.kt:77)
at com.tanodxyz.gdownload.GDownload.freeDownloader(GDownload.kt:415)
at com.tanodxyz.gdownload.GDownload.freeDownloader$default(GDownload.kt:398)
at org.goldenquran.freesoft.ui.booksLibrary.UtilsKt.downloadBookItem(Utils.kt:28)
at org.goldenquran.freesoft.ui.booksLibrary.BooksListFragment$setBooks$1$1.invoke(BooksListFragment.kt:68)
at org.goldenquran.freesoft.ui.booksLibrary.BooksListFragment$setBooks$1$1.invoke(BooksListFragment.kt:69)
at org.goldenquran.freesoft.ui.booksLibrary.BooksListAdapter.onBindViewHolder$lambda$1(BooksListAdapter.kt:77)
at org.goldenquran.freesoft.ui.booksLibrary.BooksListAdapter.$r8$lambda$_XjqJdT-IdMqBeMhCfmxZBPr_Ts(Unknown Source:0)
at org.goldenquran.freesoft.ui.booksLibrary.BooksListAdapter$$ExternalSyntheticLambda0.onClick(Unknown Source:4)
at android.view.View.performClick(View.java:7465)
at android.view.View.performClickInternal(View.java:7438)
at android.view.View.access$3600(View.java:813)
at android.view.View$PerformClick.run(View.java:28511)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:268)
at android.app.ActivityThread.main(ActivityThread.java:8019)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
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.