Spring for Android
  1. Spring for Android
  2. ANDROID-51

Add callback method for receiving download progress status in RestTemplate

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: rest-template
    • Labels:
      None

      Description

      In Android it would be nice to display a progress dialog when performing a network request with RestTemplate. In order to accomplish that RestTemplate must provide a status of the download, including how much data has been downloaded, and the total amount expected in the response.

        Activity

        Hide
        Daniel Frey added a comment -

        Is it possible for android to provide this information directly? When viewing logcat in the IDE for either an actual device or the android emulator, it is stating the size of the segments downloaded in what appears to be a separate thread. It might just be for logging, but it seems that somewhere along the line android knows this information.

        Show
        Daniel Frey added a comment - Is it possible for android to provide this information directly? When viewing logcat in the IDE for either an actual device or the android emulator, it is stating the size of the segments downloaded in what appears to be a separate thread. It might just be for logging, but it seems that somewhere along the line android knows this information.
        Hide
        Daniel Frey added a comment -
        Show
        Daniel Frey added a comment - There is also this API as of ICS, i believe: http://developer.android.com/reference/android/app/DownloadManager.html
        Hide
        Roy Clarkson added a comment -

        Looks like querying COLUMN_BYTES_DOWNLOADED_SO_FAR in DownloadManager should help determine the progress. Otherwise, we'll need to use the content-length to calculate the progress.

        Show
        Roy Clarkson added a comment - Looks like querying COLUMN_BYTES_DOWNLOADED_SO_FAR in DownloadManager should help determine the progress. Otherwise, we'll need to use the content-length to calculate the progress.
        Hide
        Thomas Bruyelle added a comment -

        Afaik DownloadManager cannot be used with RestTemplate, a callback is really needed

        Show
        Thomas Bruyelle added a comment - Afaik DownloadManager cannot be used with RestTemplate , a callback is really needed

          People

          • Assignee:
            Roy Clarkson
            Reporter:
            Roy Clarkson
          • Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated: