android-upload-service-2.0
Improvements:
- Multi threaded uploading (thanks to @mabdurrahman) which allows to have multiple symultaneous upload requests
- Auto detect content type for uploaded files, if not specified
- node.js demo server now shows also the mime type of the uploaded files
- Possibility to auto delete files after successful upload
- Possibility to auto generate a unique uploadID if not explicitly specified in the request constructor
- Possibility to switch from fixed length streaming mode to chunked streaming mode
- Better handling of server responses
- Refactored the internal structure of the project to allow to extend the library with custom upload requests, without having to modify library files
- Enhanced demo app to show progress of multiple uploads (thanks to @mabdurrahman) and to be able to select streaming mode, set auto file deletion and auto clear of the notification
Migrating to 2.0 from 1.6:
- Library namespace has been changed from
com.alexbbb
tonet.gotev
to be able to deploy artifacts also on Maven Central. Full story here: #84 - To stop all the uploads, use
UploadService.stopAllUploads()
instead ofUploadService.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 yourUploadServiceBroadcastReceiver
onError
method anymore. To add your business logic when the user cancels an upload, override the newonCancelled(String uploadId)
method in your broadcast receiver implementation.