Upload an image from Android to Amazon S3?

前端 未结 7 2052
不知归路
不知归路 2021-02-01 06:42

I need to upload a bitmap to Amazon S3. I have never used S3, and the docs are proving less than helpful as I can\'t see anything to cover this specific requirement. Unfortunate

7条回答
  •  时光说笑
    2021-02-01 07:25

    Take a look at the Amazon S3 API documentation to get a feel for what can and can't be done with Amazon S3. Note that there are two APIs, a simpler REST API and a more-involved SOAP API.

    You can write your own code to make HTTP requests to interact with the REST API, or use a SOAP library to consume the SOAP API. All of the Amazon services have these standard API endpoints (REST, SOAP) and in theory you can write a client in any programming language!

    Fortunately for Android developers, Amazon have released a (Beta) SDK that does all of this work for you. There's a Getting Started guide and Javadocs too. With this SDK you should be able to integrate S3 with your application in a matter of hours.

    The Getting Started guide comes with a full sample and shows how to supply the required credentials.

    Conceptually, Amazon S3 stores data in Buckets where a bucket contains Objects. Generally you'll use one bucket per application, and add as many objects as you like. S3 doesn't support or have any concept of folders, but you can put slashes (/) in your object names.

提交回复
热议问题