Hi, all:
I'm a developer access retrofit about several days.
I know you should use (@Streaming) annotation to avoid OOM while downloading a file.
At the same time you hope you could get the downloading progress, I achieve that by using the ProgressResponseBody.
The problem is when you use (@Streaming), you will not Buffer the entire body and thus my question is
How to get the downloading progress when you use (@Streaming) at the same time.
Best Wishes.
You can see a full working example at https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/Progress.java. Basically: count the bytes by wrapping the Source (or InputStream).
How to ensure that only initialize a OkHttpClient object?
can explain it ?
How to ensure that only initialize a OkHttpClient object?