What is the best way to capture the progress of fi...
# android
u
What is the best way to capture the progress of file upload and download using Retrofit with kotlin I have two different codes 1. I created a request extended class and performing update and getting callback in interface 2. I created extension function with request body and collecting it in flow by calculating the file size and content delivered But in both cases I have to write a lot and I need one plug and play solution, by above i created a function and calling it from many places Any recommendations?
The problem I am facing is that I am using it in coroutines and it is not like other api calls that returns exact type of response data class Instead I need to collect the progress and update the view Is there any better approach?
z
This is 😶 for the most part, but I wrote about this problem and the possible solutions here https://dev.to/zsmb13/adventures-in-tracking-upload-progress-with-okhttp-and-retrofit-1gff
u
I know it has some parts totally not kotlin But I am not getting help from other sources so asked here
Thank you for the link I will go through it
I just checked the link My code is very much similar
Thank you
173 Views