从android轻松上传到S3 [英] Simple upload to S3 from android
问题描述
我在网上搜索了从android上传一个简单文件到s3的方法,但是找不到任何有用的东西,我认为这是因为缺乏具体步骤。
I've searched the web for ways to upload a simple file to s3 from android but couldn't find anything that work and I think it is because lack of concrete steps.
1。)
https://mobile.awsblog。 com / post / Tx1V588RKX5XPQB / TransferManager-for-Android
这是我发现的最佳指南,但它没有说明要包含哪些库。我下载了用于android的aws sdk,里面有很多罐子。直觉上,我包含了aws-android-sdk-s3-2.2.5.jar,但这并不完整。它没有BasicAWSCredentials类。
That is the best guide I found but it does not tell what libraries to include. I downloaded the aws sdk for android and inside there were many jars. So intuitively, I included the aws-android-sdk-s3-2.2.5.jar however that is not complete. It does not have the class BasicAWSCredentials.
2.)我在样本中看到了更多,但它不是直截了当的#1而我无法得到带凭证的核心上传功能。
2.)I've looked at the more at the sample but it is not straightforward as #1 and I couldn't get the core upload functionality with credentials.
感谢您的帮助
推荐答案
对不起这篇文章是很久以前写的:)。
Sorry the post was written a long time ago :).
1)要使它工作,你需要aws-android-sdk-core-2.2.5.jar除了aws.android-sdk-s3-2.2.5.jar。
1) To make it work, you need aws-android-sdk-core-2.2.5.jar in addition to aws.android-sdk-s3-2.2.5.jar.
2)你指的是哪个样本?最近,AWS Android SDK引入了TransferUtility作为TransferManager的替代品。您可以在此处找到示例。还有一个博客解释了迁移 AWS SDK for Android Transfer Manager to Transfer Utility Migration Guide 。
2) Which sample are you referring to? Recently the AWS Android SDK introduced TransferUtility as an replacement of TransferManager. You can find a sample here. Also there is a blog which explains the migration AWS SDK for Android Transfer Manager to Transfer Utility Migration Guide.
PS:不建议在移动应用中使用AWSBasicCredentials。相反,尝试Cognito Identity。请参阅其开发者指南。
PS: it's not recommended to use AWSBasicCredentials in a mobile app. Instead, try Cognito Identity. See its developer guide.
这篇关于从android轻松上传到S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!