0
I’m trying to do it this way:
public AmazonS3Client getS3Client(Context context) {
BasicAWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
s3Client = new AmazonS3Client(credentials);
s3Client.setRegion(Region.getRegion(Regions.US_EAST_2));
return s3Client;
}
public void createBucket() {
if(amazonS3Client.doesBucketExist(bucketName)) {
Log.e(TAG, "Já existe");
} else {
amazonS3Client.createBucket(bucketName);
Log.i(TAG, "Deu certo.");
}
}
But I’m not sure if you need any more parameters or not. That would be the right way?
I wouldn’t recommend leaving your AWS credentials in a Java application, APK can be easily decompiled and your credentials will be exposed. The best way would be to call a backend safely, and the backend perform operations on the Buckets.
– nullptr