简体   繁体   English

亚马逊S3和android

[英]amazon S3 and android

I am trying to write an application that downloads pictures from amazon s3 server and presents the pictures as a slideshow on the application. 我正在尝试编写一个从amazon s3服务器下载图片的应用程序,并将图片作为幻灯片显示在应用程序上。 The application will be bundled to a tablet device specifically for this purpose. 该应用程序将捆绑到专门用于此目的的平板电脑设备。 The device will use wifi connection to check the S3 server for pictures and download them for slideshow. 设备将使用wifi连接检查S3服务器上的图片并下载它们以进行幻灯片放映。 The main problem is making a connection to the s3 server and download the pictures.i have no idea where to start, so my question is this how do i make a connection to s3 server for download programmatically? 主要问题是连接到s3服务器并下载图片。我不知道从哪里开始,所以我的问题是如何以编程方式连接到s3服务器进行下载?

I recommend you to download the AWS SDK for Android: http://aws.amazon.com/pt/sdkforandroid/ and read its documentation. 我建议您下载适用于Android的AWS开发工具包: http//aws.amazon.com/pt/sdkforandroid/并阅读其文档。 It is really simple to use its API. 使用它的API非常简单。

After you have all your SDK and token configured at the server and your code, all you will need is a call like this to download a picture from S3: 在服务器和代码中配置了所有SDK和令牌之后,您只需要这样的调用就可以从S3下载图片:

AmazonS3 s3 = new AmazonS3Client(AWSCredentials);
S3Object object = s3.getObject(bucketName, pictureId);
object.getObjectContent();

But read the documentation, the full configuration requires quite a lot of work. 但是阅读文档,完整的配置需要相当多的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM