Hi,


i`am trying to connect to amazon S3 with this:
https://github.com/xamarin/amazon



this is my testcode:



  public static AmazonS3 client;

        protected override void OnCreate(Bundle bundle)

        {

            base.OnCreate(bundle);



            SetContentView(Resource.Layout.Main);



            Android.Util.Log.Debug("AMAZON:", "START");



            if (true)

            {

                Android.Util.Log.Debug("AMAZON:", "CHECK");

                using (client = Amazon.AWSClientFactory
.CreateAmazonS3Client("keykeykeykekyekykekykeky ",
"keykeykeykekyekykekykeky"))

                {

                    Android.Util.Log.Debug("AMAZON:", "USING");

                    try

                    {

                        using (ListBucketsResponse response =
client.ListBuckets())

                        {

                            foreach (S3Bucket bucket in response.Buckets)

                            {

                                Android.Util.Log.Debug("AMAZON:",
bucket.BucketName);



                            }

                        }

                    }

                    catch (AmazonS3Exception amazonS3Exception)

                    {

                        if (amazonS3Exception.ErrorCode != null &&

                            (amazonS3Exception.ErrorCode.Equals(
"InvalidAccessKeyId") ||

                            amazonS3Exception.ErrorCode.Equals(
"InvalidSecurity")))

                        {

                            Android.Util.Log.Debug("AMAZON:", "E1");

                        }

                        else

                        {

                            Android.Util.Log.Debug("AMAZON:",
amazonS3Exception.ErrorCode + " - " + amazonS3Exception.Message);

                        }

                    }

                }

            }

        }





But i always get an error at this line: using (ListBucketsResponse response
= client.ListBuckets())



System.NullReferenceException: Object reference not set to an instance of
an object





Any ideas? :D



Kind regards chris

* *
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to