gotev / android-upload-service

Easily upload files (Multipart/Binary/FTP out of the box) in the background with progress notification. Support for persistent upload requests, customizations and custom plugins.
Apache License 2.0
2.83k stars 692 forks source link

Feature Request - Allow sync uploading from a background worker #453

Closed natidykstein closed 5 years ago

natidykstein commented 5 years ago

I'd like to take advantage of Android's WorkManager benefits (constraints, retries, etc...) while using the upload task of the library directly.

For example - uploading synchronically from a background worker using an UploadTask instead of relying on a service to do all the heavy lifting. (in this scenario I don't need the notification as well)

Today everything is hard-wired together - there is no way to take advantage of the upload code without running through the service and notification.

I'd like to see that in future versions.

gotev commented 5 years ago

This is something I plan to do after 4.0.0 (#450) which will bring the codebase to 100% Kotlin with a better architecture and more polished APIs. Post your ideas, use cases and scenarios below and let's discuss how to best implement this integration

gotev commented 5 years ago

@natidykstein look at the 4.0.0 branch. Now it should be easier to accomplish what you asked, but I need a feedback from you to be sure the separation of responsibilities needed to run the uploads from WorkManager is on the right track

gotev commented 5 years ago

@natidykstein Upload Service 4.0.0 Alpha 01, 100% Kotlin with Android 10 support is here for developer preview! Check this issue for more information

gotev commented 5 years ago

closing for inactivity