0

I am using TransferUtility to upload big files to S3. (https://docs.aws.amazon.com/mobile/sdkforxamarin/developerguide/s3-integration-transferutility.html)

Can anyone confirm that TransferUtility creates its own Android Service for this?

Files are big, and I need to perform the upload in an Android Service to avoid the app to be killed. TransferUtility exposes an asynchronous API, but it's not clear if it creates an Android Service or not.

GaRRaPeTa
  • 5,459
  • 4
  • 37
  • 61

1 Answers1

0

In the past when I used to use AWS, I always wrapped my calls in a JobScheduler. But you should probably wrap it in a WorkManager.

public class UploadWorker extends Worker {

    public UploadWorker(
        @NonNull Context context,
        @NonNull WorkerParameters params) {
        super(context, params);
    }

    @Override
    public Result doWork() {
      // Do the work here.

      transferLargeFilesToAws()

      // Indicate whether the task finished successfully with the Result
      return Result.success()
    }
}
Isai Damier
  • 976
  • 6
  • 8