Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
minbi authored May 11, 2018
2 parents ca037ab + f81d817 commit 45b380e
Show file tree
Hide file tree
Showing 6,155 changed files with 130,602 additions and 14,053 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ android:
- tools # see https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943)
- platform-tools
- build-tools-24.0.2
- build-tools-19.1.0
- android-11
- android-15
- android-21
sudo: true
script:
- sudo rm /etc/mavenrc
- sudo rm -f /etc/mavenrc
- export MAVEN_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m"
- export LINUX_21="${basedir}/../android-21-linux.jar"
- export ANDROID_21="/../../../../../../usr/local/android-sdk/platforms/android-21/android.jar"
- sed -i "s,$LINUX_21,$ANDROID_21," aws-android-sdk-kinesisvideo/pom.xml
- sed -i "s,$LINUX_21,$ANDROID_21," aws-android-sdk-pinpoint/pom.xml
- cat aws-android-sdk-kinesisvideo/pom.xml
- mvn clean install -Dmaven.javadoc.skip=true cobertura:cobertura

after_success:
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -s https://codecov.io/bash)
362 changes: 330 additions & 32 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Proguard.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ <h2>Modifying proguard-project.txt for the AWS SDK for Android</h2>
<pre>
# Class names are needed in reflection
-keepnames class com.amazonaws.**
-keepnames class com.amazon.**
# Request handlers defined in request.handlers
-keep class com.amazonaws.services.**.*Handler
# The following are referenced but aren't required to run
Expand Down
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# AWS SDK for Android

[![Build Status](https://travis-ci.org/aws/aws-sdk-android.png?branch=master)](https://travis-ci.org/aws/aws-sdk-android)
[![GitHub release](https://img.shields.io/github/release/aws/aws-sdk-android.svg)]()
[![GitHub release](https://img.shields.io/github/release/aws/aws-sdk-android.svg)](https://github.com/aws/aws-sdk-android/releases)
[![Maven Central](https://img.shields.io/maven-central/v/com.amazonaws/aws-android-sdk-pom.svg)]()
[![Twitter Follow](https://img.shields.io/twitter/follow/awsformobile.svg?style=social&label=Follow)]()

The [AWS SDK for Android](http://aws.amazon.com/sdkforandroid) provides a library and documentation for developers to build connected mobile applications using AWS.
The [AWS SDK for Android](https://aws.amazon.com/mobile/resources/) provides a library and documentation for developers to build connected mobile applications using AWS.



Expand All @@ -14,7 +14,7 @@ The [AWS SDK for Android](http://aws.amazon.com/sdkforandroid) provides a librar

* **[Code Samples](https://github.com/awslabs/aws-sdk-android-samples)** - Repository of example projects using the SDK.
* **[AWS Mobile Forum](https://forums.aws.amazon.com/forum.jspa?forumID=88)** – Ask questions, get help, and give feedback
* **[Developer Guide](http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/)** - For in-depth getting started and usage information.
* **[Developer Guide](https://docs.aws.amazon.com/aws-mobile/latest/developerguide/getting-started.html)** - For in-depth getting started and usage information.
* **[Javadoc](http://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/)** - For operations, parameters, responses, and examples
* **[AWS Mobile Developer Blog](http://mobile.awsblog.com/)** - For updates and guidance on using the AWS SDK for Android
* **[Release Notes](https://aws.amazon.com/releasenotes/Android)** - To see the latest features, bug fixes, and changes in the SDK
Expand All @@ -29,29 +29,34 @@ This section explains how to understand and work with the various components of

The AWS SDK for Android supports the following AWS services:

* [Amazon API Gateway](https://aws.amazon.com/api-gateway/)
* [Amazon Auto Scaling](https://aws.amazon.com/autoscaling/)
* [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/)
* [Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_GettingStarted.html)
* [Amazon Cognito](https://aws.amazon.com/cognito/)
* [Amazon Cognito Auth](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-userpools-server-contract-reference.html)
* [Amazon DynamoDB](https://aws.amazon.com/dynamodb/)
* [Amazon Elastic Compute Cloud (EC2)](https://aws.amazon.com/ec2/)
* [Amazon Elastic Load Balancing (ELB)](https://aws.amazon.com/elasticloadbalancing/)
* [AWS IoT](https://aws.amazon.com/iot/)
* [AWS Key Management Service (KMS)](https://aws.amazon.com/kms/)
* [Amazon Kinesis Firehose](https://aws.amazon.com/kinesis/firehose/)
* [Amazon Kinesis Streams](https://aws.amazon.com/kinesis/streams/)
* [Amazon Kinesis Video Streams](https://aws.amazon.com/kinesis/video-streams/)
* [AWS Lambda](https://aws.amazon.com/lambda/)
* [Amazon Lex](https://aws.amazon.com/lex)
* [Amazon Machine Learning](https://aws.amazon.com/machine-learning/)
* [Amazon Mobile Analytics](https://aws.amazon.com/mobileanalytics/)
* [Amazon Polly](https://aws.amazon.com/polly/)
* [Amazon Pinpoint](https://aws.amazon.com/pinpoint/)
* [Amazon Polly](https://aws.amazon.com/polly/)
* [Amazon Rekoginiton](https://aws.amazon.com/rekognition/)
* [Amazon S3](https://aws.amazon.com/s3/)
* [Amazon Security Token Service (STS)](https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html)
* [Amazon Simple Email Service (SES)](https://aws.amazon.com/ses/)
* [Amazon Simple Notification Service (SNS)](https://aws.amazon.com/sns/)
* [Amazon Simple Queue Service (SQS)](https://aws.amazon.com/sqs/)
* [Amazon SimpleDB](https://aws.amazon.com/simpledb/)
* [Auto Scaling](https://aws.amazon.com/autoscaling/)
* [AWS Key Management Service (KMS)](https://aws.amazon.com/kms/)
* [AWS Lambda](https://aws.amazon.com/lambda/)
* [Elastic Load Balancing](https://aws.amazon.com/elasticloadbalancing/)


* [Amazon Transcribe](https://aws.amazon.com/transcribe/)

### A Quick Code Example

Expand Down Expand Up @@ -95,7 +100,7 @@ private class S3Example extends AsyncTask<Void,Void,Void>{
### SDK Fundamentals
There are only a few fundamentals that are helpful to know when developing against the AWS SDK for Android.

* Never embed credentrials in an Android application. It is trivially easy to decompile applications and steal embedded credentials. Always use temporarily vended credentials from services such as [Amazon Cognito Identity](http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html).
* Never embed credentrials in an Android application. It is trivially easy to decompile applications and steal embedded credentials. Always use temporarily vended credentials from services such as [Amazon Cognito Identity](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html).
* Unless explicitly stated, calls are synchronous and must be taken off of the main thread.
* Unless explicitly stated, calls can always throw an AmazonServiceException or an AmazonClientException (depending on if the exception is generated by the client or the service).
* The SDK will handle re-trying requests automatically, but unless explicitly stated will throw an exception if it cannot contact AWS.
Expand All @@ -104,16 +109,24 @@ There are only a few fundamentals that are helpful to know when developing again

### Basic Service API Calls

The SDK provides access to many AWS Services. At the most basic level the SDK provides a request/response model for many of the various service methods. At this level, for a given service, you will have a client that accepts request objects and will pass back a response object, or throw an error. This basic model is shown in the above example. Looking at the [Javadoc](http://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/) you will notice that services typically have a com.amazonaws.services.*servicename* packageand com.amazonaws.services.*servicename*.model package . This *servicename* package contains the client that you will pass request/response objects to in order to make service calls. The *servicename*.model package contains classes that model the request and response parameters of calls to and from AWS services.
The SDK provides access to many AWS Services. At the most basic level the SDK provides a request/response model for many of the various service methods. At this level, for a given service, you will have a client that accepts request objects and will pass back a response object, or throw an error. This basic model is shown in the above example. Looking at the [Javadoc](http://docs.aws.amazon.com/AWSAndroidSDK/latest/javadoc/) you will notice that services typically have a com.amazonaws.services.*servicename* package and com.amazonaws.services.*servicename*.model package . This *servicename* package contains the client that you will pass request/response objects to in order to make service calls. The *servicename*.model package contains classes that model the request and response parameters of calls to and from AWS services.


### Mobile Connectors

The SDK also provides a higher level experience for many service.
The SDK also provides a higher level experience for many services.

### S3 Transfer Utility

The TransferUtility adds convenience and reliability on top of using the standard `AmazonS3Client` when uploading and downloading data to S3:

* Enhances performance by automatically converting upload transfers > 5MB to multi-part uploads, using multiple threads.
* Provides the ability to pause/resume/cancel upload/download transfers, which is useful if the app is being killed or loses internet connectivity.
* Automatically pauses/resumes upload/download transfers when network connectivity changes.

### S3 Transfer Manager
### S3 Transfer Manager (Deprecated)

The Transfer Manager adds convenience and reliability ontop of using the standard AmazonS3Client when uploading and downloading binary data to S3:
The Transfer Manager adds convenience and reliability on top of using the standard `AmazonS3Client` when uploading and downloading binary data to S3:

* Enhances performance by automatically converting large requests to multi-part uploads, using multiple threads.
* Allows developers to pause/resume uploads/downloads, which is especially useful if the app is being killed or loses internet connectivity.
Expand Down Expand Up @@ -143,7 +156,7 @@ The Amazon Cognito mobile connector provides the ability to:
* Synchronize user profile data, app preferences or game state across devices and across login providers.
* Record and update user data while offline.

Note: The Cognito Identity classes are a part of core jar (as well as the core Maven package). The Cognito Sync source code is in a separate repository, and can be found [here](https://github.com/aws/amazon-cognito-android).
**Note**: The Amazon Cognito Federated Identities classes are part of `AWS SDK for Android - Core` (`aws-android-sdk-core` Maven package) and can be found [here](https://github.com/aws/aws-sdk-android/tree/master/aws-android-sdk-core). The Amazon Cognito Sync code can be found [here](https://github.com/aws/aws-sdk-android/tree/master/aws-android-sdk-cognito).


### Amazon Mobile Analytics
Expand Down Expand Up @@ -209,6 +222,7 @@ Note: Cognito Identity authentication abilities are included in the aws-android-
* ec2 (Amazon EC2),
* sdb (Amazon Simple DB),
* polly (Amazon Polly)
* transcribe (Amazon Transcribe)

#### Using Maven

Expand Down Expand Up @@ -278,4 +292,4 @@ If you are using a Mac, you may run into issues when trying to compile, because

## To learn more about Android Development

For more information on Andorid development, see the Android developer site at: [developer.android.com](http://developer.android.com/index.html)
For more information on Android development, see the Android developer site at: [developer.android.com](http://developer.android.com/index.html)
4 changes: 2 additions & 2 deletions aws-android-sdk-apigateway-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.4.7</version>
<version>2.6.19</version>
</parent>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.4.7</version>
<version>2.6.19</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
69 changes: 69 additions & 0 deletions aws-android-sdk-auth-core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-auth-core</artifactId>
<packaging>aar</packaging>
<name>AWS SDK for Android - AWS Authentication Core</name>
<description>The AWS Android SDK for AWS Authentication Core module holds the client classes that are used for enabling communication with Amazon CognitoIdentityProvider, Amazon Cognito UserPools, Facebook and Google SignIn Providers</description>
<url>http://aws.amazon.com/sdkforandroid</url>

<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
</properties>

<parent>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-pom</artifactId>
<version>2.6.19</version>
</parent>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-android-sdk-core</artifactId>
<optional>false</optional>
<version>2.6.19</version>
</dependency>

<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.5.0</version>
<extensions>true</extensions>
<configuration>
<sdk>
<platform>11</platform>
<buildTools>19.1.0</buildTools>
</sdk>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
5 changes: 5 additions & 0 deletions aws-android-sdk-auth-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws.mobile.auth.core">

<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="25" /></manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2013-2017 Amazon.com, Inc. or its affiliates.
* All Rights Reserved.
*
* 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.
*/

package com.amazonaws.mobile.auth.core;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import com.amazonaws.mobile.auth.core.R;

/**
* A default base class easing the work required for implementing the SignInResultHandler for
* {@link IdentityManager#login(Context, SignInResultHandler)} by providing default
* behavior in the case that the user cancels signing in or encounters an error. The default for
* canceling is to toast that sign-in was canceled. The default for a sign-in error is to show
* an alert dialog specifying the error message.
*/
public abstract class DefaultSignInResultHandler implements SignInResultHandler {
private static final String LOG_TAG = DefaultSignInResultHandler.class.getSimpleName();

/**
* User cancelled signing in with a provider on the sign-in activity.
* Note: The user is still on the sign-in activity when this call is made.
* @param provider the provider the user canceled with.
*/
public void onIntermediateProviderCancel(Activity callingActivity, IdentityProvider provider) {
Log.d(LOG_TAG, String.format("%s Sign-In flow is canceled", provider.getDisplayName()));
}

/**
* User encountered an error when attempting to sign-in with a provider.
* Note: The user is still on the sign-in activity when this call is made.
* @param provider the provider the user attempted to sign-in with that encountered an error.
* @param ex the exception that occurred.
*/
public void onIntermediateProviderError(Activity callingActivity, IdentityProvider provider, Exception ex) {
final String failureFormatString = callingActivity.getString(R.string.sign_in_failure_message_format);
Log.e(LOG_TAG, String.format(failureFormatString,
provider.getDisplayName(), ex.getMessage()), ex);
}
}
Loading

0 comments on commit 45b380e

Please sign in to comment.