I'm using the aws sample code to upload files to the S3, but when they get uploaded they come with no access for anyone, even with the bucket made Public for everyone, the only way to read it is to manually set the files on the S3 console to give public access.
MyService:
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent != null && intent.getStringExtra(INTENT_KEY_NAME) != null) {
final String key = intent.getStringExtra(INTENT_KEY_NAME);
final File file = (File) intent.getSerializableExtra(INTENT_FILE);
final String transferOperation = intent.getStringExtra(INTENT_TRANSFER_OPERATION);
TransferObserver transferObserver;
switch (transferOperation) {
case TRANSFER_OPERATION_DOWNLOAD:
Log.d(TAG, "Downloading " + key);
transferObserver = transferUtility.download("aws-MYBUCKET", key, file);
transferObserver.setTransferListener(new DownloadListener());
break;
case TRANSFER_OPERATION_UPLOAD:
Log.d(TAG, "Uploading " + key);
transferObserver = transferUtility.upload("aws-MYBUCKET", key, file);
transferObserver.setTransferListener(new UploadListener());
break;
}
return START_STICKY;
} else return START_NOT_STICKY;