Search code examples
androidamazon-web-servicesamazon-s3s3-bucket

How to display images from AWS S3 without downloading in the local storage


My android app shows images which is downloaded from AWS S3. For now I download the images to the local storage, and show images from the downloaded images. But, it would be annoying from the user's perspective.

How can I display image from AWS S3 without downloading into the local storage. It would be great if I can display images not with the file but with image url.

It might be possible by set the files on ASW S3 to public, which I want to avoid for security issues.


Solution

  • Firstly generate pre-signed AWS S3 URL and then load image using Glide. Below are steps:

    1. How to generate pre-signed AWS S3 bucket URL check here

    2. Load image using Glide:

      Glide.with(getActivity().getBaseContext()).load("IMAGE URL FROM S3").centerCrop().into(imageView);