aws/aws-sdk-android — pull request #5 by eroninjapan (2013-05-08 23:17:31+00:00)
Title: Incomplete region/endpoint specification causes exception

Exception encountered when trying to run the S3_SimpleDB_SNS_SQS_DemoTVM sample app:

```java
AmazonS3Exception: Status Code: 301, AWS Service: Amazon S3, AWS Request ID: ---, AWS Error Code: PermanentRedirect, AWS Error Message: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint., S3 Extended Request ID: ---
java.lang.NullPointerException
at com.amazonaws.demo.anonymous.s3.S3BucketView.obtainListItems(S3BucketView.java:68)
at com.amazonaws.demo.anonymous.CustomListActivity$2.run(CustomListActivity.java:147)
```

When specifying a region using setRegion(), the SDK also expects an accompanying call to setEndpoint(). A list of regions and endpoints was found here: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

I found that I could also make things work by adding an endpoint using `s3Client.setEndpoint("s3.amazonaws.com");` but that further makes the code specific to a given region/endpoint, thus went the route of removing the region setting instead.

Tested to work so far with my current AWS setup: an S3 bucket in the Northern California region