Android Open Source - aws_assume_role List Buckets Task

From Project

Back to project page aws_assume_role.


The source code is released under:

MIT License

If you think the Android project aws_assume_role listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jstewart.testamazonlogin;
/*from  ww  w .java2  s. c  o m*/
import java.util.List;

import android.os.AsyncTask;


public class ListBucketsTask extends AsyncTask<AmazonS3Client, Void, String> {

  private LoginFragment fragment;

  public ListBucketsTask(LoginFragment fragment) {
    this.fragment = fragment;

  protected String doInBackground(AmazonS3Client... clients) {
    ObjectListing listing = clients[0].listObjects(""); //add bucket name
    List<S3ObjectSummary> summaries = listing.getObjectSummaries();

    String names = "";

    for (S3ObjectSummary summary : summaries) {
      names = names + summary.getKey()
          + "\n"; 
    return names;

  protected void onPostExecute(String itemNames) {

Java Source Code List