从上传的Andr​​oid到Amazon S3的形象呢?形象、上传、Andr、oid

2023-09-12 23:36:53 作者:saphead(笨蛋蛋)

我需要上传一个位图到Amazon S3。我从来没有使用S3和文档被证明不到有用的,因为我也看不出什么来弥补这一具体要求。不幸的是,我苦苦寻找的时间在这个项目上花费一整天的时间学习它是如何挂在一起,希望你们中的一个好心人能给我一些指点。

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. Unfortunately I'm struggling to find time on this project to spend a whole day learning how it all hangs together so hoping one of you kind people can give me some pointers.

您可以指向我一个参考源介绍了如何推动一个文件到S3,并获得一个URL引用回报?

Can you point to me to a source of reference that explains how to push a file to S3, and get a URL reference in return?

更具体地说: - 在哪里凭据使用S3的Andr​​oid SDK的时候去? - 我需要上传文件之前创建一个水桶,也可以存在外桶? - 哪些SDK方法我用推一个位图最多S3? - 难道我就在想我需要的核心和S3库做什么,我需要的,并没有其他人。

More specifically: - Where do the credentials go when using the S3 Android SDK? - Do I need to create a bucket before uploading a file, or can they exist outside buckets? - Which SDK method do I use to push a bitmap up to S3? - Am I right in thinking I need the CORE and S3 libs to do what I need, and no others?

推荐答案

看看的亚马逊S3 API文档来感受一下什么可以和什么不能与Amazon S3的完成。需要注意的是有两个API,一个简单的REST API和一个更涉及SOAP API。

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.

您可以编写自己的code键使HTTP请求与REST API交互,或使用SOAP库消耗SOAP API。所有亚马逊服务的有这些标准的API端点(REST,SOAP),并在理论上可以在任何编程语言编写客户端!

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!

幸运的是Android开发者,亚马逊已经发布了一(测试版)SDK ,做这项工作的所有为你。有一个入门指南和的的Javadoc 了。有了这个SDK,你应该能够S3在几个小时内就您的应用程序集成。

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.

从概念上讲,在桶,其中一个桶中包含的对象的Amazon S3存储数据。一般来说,你将使用每个应用程序一斗,并根据需要添加尽可能多的对象。 S3不支持或者文件夹的任何概念,但你可以把斜杠(/)的对象名。

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.