Android Question Why doesn't the Progress bar display with httpUtils2

Discussion in 'Android Questions' started by Arun, Jul 21, 2015.

  1. Arun

    Arun Member Licensed User


    I am using httpUtils2 library to download about 200 small files, each of 1-2 kb, in a loop which has been successfully tested.

    I want to display a progress bar for the downloads, and I cant seem to get it to work.

    I tried adding the ProgressBar as a view in the Designer, I tried adding it directly to the activity and then using Activity.AddView, but no success.

    I have set pbValue as int to 0 before i start the download loop.
    In the JobDone event, i increment this value by 1 and set ProgressBar.progress = pbValue (I also use this variable to check that all downloads have been completed)

    I have already gone thru all the examples, questions, tutorials, alternatives but could not find anything suitable, even after adapting the various alternatives (FTP Progress Bar, Download Service etc, etc)

    Thanks in advance

  2. DonManfred

    DonManfred Expert Licensed User

    Without seeing our code we just can GUESS what you did and how.
    Create a small project which shows the problem and export the project as zip (In B4A IDE: File->Export as zip) and upload it here.

    A simple httputils-call will not raise any progress-update-events.
    Asuming you are using a global list for the download to track.
    This should work if you do it right. But again: Without seeing our code we just can GUESS what you did and how.
    lemonisdead likes this.
  3. Arun

    Arun Member Licensed User

    Thanks for the quick reply.

    I will create a new project with the relevant portions from my code and upload the zip tomorrow.
  4. Arun

    Arun Member Licensed User

    I have uploaded my project (with links and file names suppressed).

    The files get downloaded and the app is working perfectly.

    I wanted to introduce the progress bar since the process needs to wait till all the files are downloaded and the user should have an indication of the download status.

    Thanks again in advance

    Attached Files:

  5. Cüneyt Gargin

    Cüneyt Gargin Member Licensed User

    I have the same problem... I download around 20 small files to download via FTP. But since FTP is working asynchronous, even I change progress bar value in FTP_DownloadProgress and FTP_DownloadComplete, it does not react.. I put DoEvents to repaint UI , but it does not work either..
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice