how to set ACL for an object while uploading it to Amazon s3?
<p>i can upload images from Android to Amazon s3. But they are always private, no one can display them. i have to make it public on Amazon s3 management console. i can not set ACL for an image while uploading it. </p>

<p>I learned that, there are two ways to upload image to Amazon s3 from Android:</p>

<ul>
<li>using  PutObjectRequest</li>
<li>using TransferUtility.upload()</li>
</ul>

<p>i tried both. if i prefer PutObjectRequest, i have to use AsyncTask or another thread. Because PutObjectRequest runs on main thread. But i do not want to use AsyncTask or another thread.</p>

<p>i want to use TransferUtility, because it does not run on main thread, works on service, so i do not have to use AsyncTask or another thread. Also i can track progress and state of transfer easily. In addition, TransferUtility is newer than PubObjectRequest. But the problem comes here: i do not know how to set ACL for an object while or before uploading it to s3. i tried that :</p>

<pre><code>s3Client.setObjectAcl("myBucket", "steve_jobs.jpg", CannedAccessControlList.PublicRead);
</code></pre>

<p>but it returned "network on main thread" error. So i need to use AsyncTask or another thread.but i do not want to use AsyncTask or another thread. how can i set ACL for an object while uploading it with TransferUtility?</p>