扫码关注官方订阅号
upyun android的sdk如何做上传进度? 谢谢
走同样的路,发现不同的人生
没用过upyun的sdk,一般的做法是,在写数据的代码中记录
long writed; long total; int oldPregress; while(writed < total) { writed += write(buffer); // 返回已经上传的字节数 int progress = ((float) writed / total) * 100 if (oldProgress != progress) { notifyProgressChagned(progress); oldProgress = progress; } }
另外一种做法是,把writed和total通过回调函数通知出去,外面自己计算进度或者干点其他事。
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
没用过upyun的sdk,一般的做法是,在写数据的代码中记录
另外一种做法是,把writed和total通过回调函数通知出去,外面自己计算进度或者干点其他事。