Closed hamza0786 closed 1 month ago
You can download from anywhere it may not necessarily be MainFragment or any screen. Ketch is a singleton class, you can inject it in any of your class as per your use case and call download function. For observing, you can observe it in any scope, just call observeDownloads function. In case you do not want to inject the class externally just call like this from any class.
val ketch = Ketch.builder().build(context)
ketch.download(url, fileName, path)
CoroutineScope(Dispatchers.IO).launch {
ketch.observeDownloads().collect{ list->}
}
Make sure to cancel the scope at appropriate place to avoid unnecessary observing
Hi its working but asa i close the app or put app in background the download stopped progressing and then it Failed any solution? of this will be appericiated!
no need i figured it out. thanks for reaching me out!
Hi Brother!
how can i start the download automatically without going to the mainfragment by passing the download url through Bundle arguments.
like this for example:
https://github.com/user-attachments/assets/e1b63a4c-24d5-478a-a84f-7850a28d49e9