从AndroidHttpClient进度通知 [英] Progress notifications from AndroidHttpClient
问题描述
我与Android 3.0和3.1工作。
我用的是类AndroidHttpClient在我的应用程序,为执行我使用execute(HttpUriRequest)。
I am working with Android 3.0 and 3.1. I use the class AndroidHttpClient in my application and for the execute I use execute(HttpUriRequest).
我有,我想在发送数据要更新的用户界面的进度条。
有没有办法从AndroidHttpClient获取有关数据发送(我猜它不发送一次性全缓冲)?
I have a progress bar in the UI that I want to be updated while sending data. Is there any way to get notifications from the AndroidHttpClient about the progress of the data sending (I guess it doesn't send the whole buffer in one shot)?
感谢
推荐答案
要跟踪数据的进步,因为它是发送到您必须包装正在发送潜在的HTTP实体服务器。如果你继承 HttpEntityWrapper 并覆盖的writeTo()
可以包装器的OutputStream 带有 FilterOutputStream中的是被写入到服务器的流。
To track the progress of data as it is sent to the server you have to wrap the underlying HTTP entity that is being sent. If you subclass HttpEntityWrapper and override writeTo()
you can wrapper the OutputStream with a FilterOutputStream that is the stream being written to the server.
这篇关于从AndroidHttpClient进度通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!