Skip to content

android-upload-service-2.0

Compare
Choose a tag to compare
@gotev gotev released this 22 Jan 19:17
· 549 commits to master since this release

Improvements:

Migrating to 2.0 from 1.6:

  • Library namespace has been changed from com.alexbbb to net.gotev to be able to deploy artifacts also on Maven Central. Full story here: #84
  • To stop all the uploads, use UploadService.stopAllUploads() instead of UploadService.stopCurrentUpload()
  • The UploadServiceBroadcastReceiver onCompleted signature has been changed from:
public void onCompleted(String uploadId, int serverResponseCode, int serverResponseCode,
                        String serverResponseMessage)

to

public void onCompleted(String uploadId, int serverResponseCode, int serverResponseCode,
                        byte[] serverResponseBody)

to handle better server responses. Before it handled only utf 8 responses terminated with a new line character. That was limitating. To achieve the old 1.6 behaviour, you need to add:

String serverResponseMessage = new String(serverResponseBody);

in your implementation.

  • When an upload task is cancelled, you will not receive a java.net.ProtocolException in your UploadServiceBroadcastReceiver onError method anymore. To add your business logic when the user cancels an upload, override the new onCancelled(String uploadId) method in your broadcast receiver implementation.