I tried to download 180MB zip file using AssetsManager Test. Zip file downloaded in 10 min and extracted too(seen in output window) but the label on screen was showing only 20 percent. it takes more than 45 min for label to reach 100 percent! checked on device and PC too…at both behavior is same ! is it due separate downloading thread implemented in 2.1rc0-x-2.1.4 ?
But at the same time, onProgress() shows 20 to 30 only. onSuccess() gets call after nearly 45 min in case on 180MB zip.
Could you please add log in onProgress and onSuccess to checkout if the function is invoked or not.
I have reviewed the codes, and didn’t get any idea.
I think it has something to do with the messagequeu, the update gets called to slow so the message queue builds up very fast and takes ages to get empty. Every time the messagequeu posts a message, there are added 100 more. So when the download is already finished, the queue needs to be empty and takes ages for some reason. =/
I think I found a solution on stackoverflow. Its because curl calls the progressfunction to quick you can fix it by
@
static time_t prevtime;
int AssetsManagerProgressFunc(void ptr, double totalToDownload, double nowDownloaded, double totalToUpLoad, double nowUpLoaded)
{
time_t currtime;
double dif;
static int first = 1;
if {
time;
first = 0;
}
time;
dif = difftime;
if
return 0;
prevtime = currtime;
AssetsManager manager = (AssetsManager**)ptr;
AssetsManager::Message**msg = new AssetsManager::Message();
msg~~>what = ACCAssetsManager_MESSAGE_PROGRESS;
ProgressMessage *progressData = new ProgressMessage;
progressData~~>percent = (int)(nowDownloaded/totalToDownload*100);
progressData~~>manager = manager;
msg~~>obj = progressData;
I’m using [ HTTP Request ] to download ZIP data like above !
I’m wonderring how to get percent download data ?
Please give me a examples
I would thank you so much