AmazonS3Client s3Client = new AmazonS3Client(credentialsProvider); was deprecated?
Function
val config = AWSConfiguration(context)
val credentialsProvider = CognitoCachingCredentialsProvider(context, config)
val s3Client = AmazonS3Client(credentialsProvider)
transferUtility = TransferUtility.builder()
.awsConfiguration(config)
.context(context)
.s3Client(s3Client)
.build()
How to configure the AWS3client?
Use AmazonS3Client(CredentialsProvider, Region)

it showing error
Probably because the types you are using for the parameters are not the same.
@Priyanka-Mohanty You need to pass the region information through the com.amazonaws.regions.Region object.
s3Client = new AmazonS3Client(credentials, Region.getRegion(Regions.US_WEST_2));
Thanks...its working @kvasukib
@kvasukib hey, should I use 'CredentialsProvider' with my secret key in my live application, anyone can decompile the APK and get my secret and access keys,
What is the right way to initialize the s3 client and use the s3 bucket storage?
Even in AWS documentation, the deprecated method is mentioned. Please guide.
@mbk820 you can use encryption technique i.e. AES encryption to encrypt Access Key and Secret key, instead of putting it directly in the code.
The way which @kvasukib have provided to use AmazonS3Client is the best. You can move forward with that.
Hope this will help.
Most helpful comment
@Priyanka-Mohanty You need to pass the region information through the
com.amazonaws.regions.Regionobject.