lizhangqu / coreprogress Goto Github PK
View Code? Open in Web Editor NEWOkHttp upload and download progress support
OkHttp upload and download progress support
As the title say I can't compile the source because bintray or another plugin, what can I do?
一秒跳了好几次,当我想加一个每秒下载量的时候总是比正常值小。
compileSdkVersion global_compileSdkVersion
buildToolsVersion global_buildToolsVersion
在你的代码里都是使用 global配置的一些编译环境,请问这个是需要替换吗?还是直接改变
Could I get the filename when download ?
log如下:
08-16 16:40:52.986 4527-4527/io.github.lizhangqu.sample E/TAG: onUIProgressStart:25930457
08-16 16:40:53.002 4527-4527/io.github.lizhangqu.sample D/TAG: =============start===============
08-16 16:40:53.003 4527-4527/io.github.lizhangqu.sample D/TAG: numBytes:8192
08-16 16:40:53.004 4527-4527/io.github.lizhangqu.sample D/TAG: totalBytes:25930457
08-16 16:40:53.004 4527-4527/io.github.lizhangqu.sample D/TAG: percent:3.1592193E-4
08-16 16:40:53.004 4527-4527/io.github.lizhangqu.sample D/TAG: speed:0.0
08-16 16:40:53.005 4527-4527/io.github.lizhangqu.sample D/TAG: ============= end ===============
08-16 16:40:53.028 4527-4527/io.github.lizhangqu.sample D/TAG: =============start===============
08-16 16:40:53.028 4527-4527/io.github.lizhangqu.sample D/TAG: numBytes:491520
08-16 16:40:53.028 4527-4527/io.github.lizhangqu.sample D/TAG: totalBytes:25930457
08-16 16:40:53.028 4527-4527/io.github.lizhangqu.sample D/TAG: percent:0.018955316
08-16 16:40:53.028 4527-4527/io.github.lizhangqu.sample D/TAG: speed:4603.0
08-16 16:40:53.028 4527-4527/io.github.lizhangqu.sample D/TAG: ============= end ===============
08-16 16:40:53.126 4527-4527/io.github.lizhangqu.sample D/TAG: =============start===============
08-16 16:40:53.126 4527-4527/io.github.lizhangqu.sample D/TAG: numBytes:1458176
08-16 16:40:53.126 4527-4527/io.github.lizhangqu.sample D/TAG: totalBytes:25930457
08-16 16:40:53.126 4527-4527/io.github.lizhangqu.sample D/TAG: percent:0.056234106
08-16 16:40:53.126 4527-4527/io.github.lizhangqu.sample D/TAG: speed:8479.0
08-16 16:40:53.127 4527-4527/io.github.lizhangqu.sample D/TAG: ============= end ===============
08-16 16:40:54.008 4527-5008/io.github.lizhangqu.sample D/TAG: =============onFailure===============
08-16 16:40:54.020 4527-5008/io.github.lizhangqu.sample E/TAG: java.net.SocketException: sendto failed: EPIPE (Broken pipe)
at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:542)
at libcore.io.IoBridge.sendto(IoBridge.java:511)
at java.net.PlainSocketImpl.write(PlainSocketImpl.java:500)
at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:37)
at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:266)
at okio.Okio$1.write(Okio.java:79)
at okio.AsyncTimeout$1.write(AsyncTimeout.java:180)
at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
at okio.RealBufferedSink.write(RealBufferedSink.java:41)
at okhttp3.internal.http1.Http1Codec$FixedLengthSink.write(Http1Codec.java:286)
at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
at okio.RealBufferedSink$1.write(RealBufferedSink.java:193)
at io.github.lizhangqu.coreprogress.ProgressOutputStream.write(ProgressOutputStream.java:39)
at okio.Okio$1.write(Okio.java:79)
at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:171)
at okio.RealBufferedSink.writeAll(RealBufferedSink.java:99)
at okhttp3.RequestBody$3.writeTo(RequestBody.java:120)
at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.java:173)
at okhttp3.MultipartBody.writeTo(MultipartBody.java:114)
at io.github.lizhangqu.coreprogress.ProgressRequestBody.writeTo(ProgressRequestBody.java:54)
how can i track progress when uploading multiple file with this
MultipartBody.Part[] param via retrofit
是OKHttp版本的原因吗?
I require to run above code in background service
cn.edu.zafu:coreprogress:1.0.3 我之前有用到这个库,今天突然下载不了了 请问这个库之前是您在维护么。和现在之歌CoreProgress是一个库么?
需要修改ProgressRequestBody中的writeTo方法,每次创建一个新的BufferedSink对象才行,否则失败
看了下源码,感觉这个问题直接导致了你的这个coreProgress不实用
上传的进度并不是真实的服务器上传进度
之前用的OkHttp添加消息头是
.addHeader("k", "v");
但是在您这边好像不一样,
.addPart(Headers.of("Content-Disposition", "form-data; name="another";filename="another.dex""),
RequestBody.create(MediaType.parse("application/octet-stream"), videoFile))
有点看不太懂,您能帮忙解释一下吗?谢谢
如果下载路径是https开头,会报错
I tried installing a react native library that has CoreProgress as a dependency but it could not be resolved because io.github.lizhangqu:coreprogress:1.0.2 was no not available. Can anyone advice on this?
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.