Amazon S3 multipart file upload for Android, made simple

Related tags

SDK android-simpl3r
Overview

Simpl3r

Amazon S3 multipart file upload for Android, made simple

screenshot

This library provides a simple high level Android API for robust and resumable multipart file uploads using the Amazon S3 service. All the complexity of file chunking, resuming, entity tag caching and interaction with Amazon's S3 API is abstracted from the developer.

This library manages synchronous file part uploads only. Part uploads performed in parallel are generally not suitable for mobile bandwidths.

Usage

Uploads can be initiated as follows:

AmazonS3Client s3Client = new AmazonS3Client(
    new BasicAWSCredentials(YOUR_S3_ACCESS_KEY, YOUR_S3_SECRET));

File file = new File("path/to/some.file");
String s3Key = file.getPath();

// create a new uploader for this file
Uploader uploader = new Uploader(this, s3Client, YOUR_S3_BUCKETNAME, s3Key, file);
    
// register listener for upload progress updates 
uploader.setProgressListener(new UploadProgressListener() {  		
    @Override
    public void progressChanged(ProgressEvent progressEvent, 
            long bytesUploaded, int percentUploaded) {
        // broadcast/notify ...
    }
});

// initiate the upload
String urlLocation = uploader.start();

Subsequent Uploader instances or calls to start() using the same s3key will attempt to resume the upload from the beginning of the last part that was uploaded successfully. A SharedPreferences instance for the supplied Context is used to cache the part ETags, or you can supply your own. You can also supply your own part size to the Uploader, but note that the minimum for the S3 API is 5 megabytes.

This project contains a working example project which more fully demonstrates its usage.

Dependencies

This library depends upon the AWS SDK for Android, specifically the following components:

  • aws-android-sdk-<VERSION>-core.jar
  • aws-android-sdk-<VERSION>-s3.jar

Building

Run ant jar from the project directory or simply download a pre-built version from the builds directory of this GitHub repository.

Credits

Author: Jeff Gilfelt

License

Copyright 2012 readyState Software Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Countly Product Analytics Android SDK
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Android Real Time Chat & Messaging SDK
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

SocialAuth repository which contains socialauth android version and samples
SocialAuth repository which contains socialauth android version and samples

SocialAuth Android is an Android version of popular SocialAuth Java library. Now you do not need to integrate multiple SDKs if you want to integrate y

Android library project for providing multiple image selection from the device.
Android library project for providing multiple image selection from the device.

PolyPicker Android library project for selecting/capturing multiple images from the device. Result Caution! Eclipse library project structure has been

Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Donations library for Android. Supports Google Play Store, Flattr, PayPal, and Bitcoin
Donations library for Android. Supports Google Play Store, Flattr, PayPal, and Bitcoin

Android Donations Lib Android Donations Lib supports donations by Google Play Store, Flattr, PayPal, and Bitcoin. It is used in projects, such as Open

Android library that provides for multiple image selection.
Android library that provides for multiple image selection.

#MultipleImageSelect An android library that allows selection of multiple images from gallery. It shows an initial album (buckets) chooser and then im

Microsoft Services SDKs for Android produced by MS Open Tech.

Important: This preview SDK has been deprecated and is no longer being maintained. We recommend that you use Microsoft Graph and the associated Micros

Comments
  • Example App: Error while uploading invalid schema

    Example App: Error while uploading invalid schema

    Error: The XML you provided was not well formed or did not validate against our published schema.

    Not sure where to look for the upload schema, but I think it's set as

    ./s3-put -T ./test2 -k -s ./ /mybucketname

    and it should be:

    ./s3-put -T ./test2 -k -s ./ /mybucketname/myfile

    opened by lovellfelix 1
  • MalformedXML error

    MalformedXML error

    When I try to upload a file using simpl3r, I get this exception. I tried a quick google search to fix, but didnt work.

    05-25 21:12:31.940: W/System.err(21275): Status Code: 400, AWS Service: Amazon S3, AWS Request ID: 25950685FA4A7BA0, AWS Error Code: MalformedXML, AWS Error Message: The XML you provided was not well-formed or did not validate against our published schema, S3 Extended Request ID: lFNEIr7bNf2wmQvoG1wztfVqTCHgRTfsXL8GQAXLWwEs7ZqMdaLdRwcXVfmz7iPm 05-25 21:12:31.940: W/System.err(21275): at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(Unknown Source) 05-25 21:12:31.940: W/System.err(21275): at com.amazonaws.http.AmazonHttpClient.executeHelper(Unknown Source) 05-25 21:12:31.940: W/System.err(21275): at com.amazonaws.http.AmazonHttpClient.execute(Unknown Source) 05-25 21:12:31.940: W/System.err(21275): at com.amazonaws.services.s3.AmazonS3Client.invoke(Unknown Source) 05-25 21:12:31.940: W/System.err(21275): at com.amazonaws.services.s3.AmazonS3Client.completeMultipartUpload(Unknown Source) 05-25 21:12:31.940: W/System.err(21275): at com.readystatesoftware.simpl3r.Uploader.start(Uploader.java:180) 05-25 21:12:31.940: W/System.err(21275): at com.readystatesoftware.simpl3r.example.UploadService.onHandleIntent(UploadService.java:105) 05-25 21:12:31.940: W/System.err(21275): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 05-25 21:12:31.940: W/System.err(21275): at android.os.Handler.dispatchMessage(Handler.java:102) 05-25 21:12:31.940: W/System.err(21275): at android.os.Looper.loop(Looper.java:136) 05-25 21:12:31.940: W/System.err(21275): at android.os.HandlerThread.run(HandlerThread.java:61)

    opened by jaydeepw 6
Owner
Jeff Gilfelt
Jeff Gilfelt
Its measurement app made using kotlin with sceneform sdk by google

ARCORE MEASUREMENT This app is build using sceneform sdk for android using kotlin language It helps you measure the distance between multiple points i

Kashif Mehmood 39 Dec 9, 2022
A very simple way to implement In App Purchases on Android.

The Google-developed Android In App Purchases library can seem quite confusing and too much code to do something as simple as making in-app purchases

Maickonn Richard 1 Sep 29, 2021
Simple Discord <-> Minecraft chat integration using webhooks

Minecraft Chat Simple Discord <-> Minecraft chat integration using webhooks Instalacja Plugin należy wrzucić do folderu plugins oraz ustawić URL webho

Oskar 10 Aug 31, 2022
CodingChallenge: A simple SDK. Which can provide you information related to Start Wars APi

CodingChallenge CodingChallenge is a simple SDK. Which can provide you informati

Wajahat Hussain 1 Feb 18, 2022
Android Weather Library: android weather lib to develop weather based app fast and easily

WeatherLib Android weather lib is an android weather aggregator. The lib helps you getting weather data from the most importat weather provider. It su

Surviving with android (by Francesco Azzola) 641 Dec 23, 2022
Sdk-android - SnapOdds Android SDK

Documentation For the full API documentation go to https://snapodds.github.io/sd

Snapodds 0 Jan 30, 2022
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 976 Dec 29, 2022
Accept PayPal and credit cards in your Android app

Important: PayPal Mobile SDKs are Deprecated. The APIs powering them will remain operational long enough for merchants to migrate, but the SDKs themse

PayPal 802 Dec 22, 2022
Powerful custom Android Camera with granular control over the video quality and filesize, restricting recordings to landscape only.

LandscapeVideoCamera Highly flexible Android Camera which offers granular control over the video quality and filesize, while restricting recordings to

Jeroen Mols 1.2k Dec 29, 2022
Library for Android In-App Billing (Version 3+)

Checkout (Android In-App Billing Library) Description Checkout is an implementation of Android In-App Billing API (v3+). Its main goal is to make inte

Sergey Solovyev 1k Nov 26, 2022