3

I am running a scheduled python script on an EC2 instance which creates and exports a JSON file to my S3 bucket for a backend. I am hitting a brick wall attempting to download the JSON file for use in an android application. The AWS mobile SDK documentation suggests the mobile SDK is depreciated in favor of AWS Amplify, but Amplify seems to be overkill for this simple backend connection, and attempts to integrate it for my project are proving nightmareish.

Is there a simple way to download from S3 using an android HTTPS request library, or should I be using a different resource for backend storage entirely? Or is the correct route to continue working to use the Amplify suite to make the connection?

Ross
  • 35
  • 7

2 Answers2

2

You can use aws-s3-transferutility api of aws mobile sdk. https://github.com/awslabs/aws-sdk-android-samples/blob/main/S3TransferUtilitySample/S3TransferUtilityTutorial.md

  • This is exactly the service I was looking for, cheers! – Ross Nov 19 '20 at 22:53
  • Is there a link that for code that uses Amplify to download a file from aws S3 bucket. in java. I heard that aws is moving towards amplify instead of was-mobile-sdk. please advise. – coder Feb 23 '22 at 09:38
  • https://docs.amplify.aws/lib/storage/getting-started/q/platform/android/#uploading-data-to-your-bucket – Rushit Vaishnani Feb 24 '22 at 04:43
1

You could use an AsyncTask to run your HTTP Request and download the file from S3.

Have a look at Android: AsyncTask to make an HTTP GET Request?

Be sure to check the permissions on the S3 side to ensure you allow for the download to happen.

Oscar De León
  • 300
  • 1
  • 2
  • 7