Expert AWS Development
上QQ阅读APP看书,第一时间看更新

AWS Mobile SDK for Android

For Android, AWS provides an open source SDK that is distributed under an Apache license. This will provide libraries, code examples, and documentation to develop mobile applications using AWS.

Currently, AWS supports the following services for AWS Mobile SDK for Android:

  • Amazon Cognito Identity:
    • Controls authentication and provides temporary credentials to connect devices and/or other untrusted environments
    • Saves user data and synchronizes it
    • Manages identity throughout the lifetime of an application
    • We will discuss this topic in more detail in Chapter 6, User Authentication with AWS Cognito
  • Amazon Cognito Sync:
    • Enables application-specific data to sync on cross-devices
    • Syncs user data across the web and devices
    • Caches data locally so the device can access data offline; it can sync when the device is online
    • Notifies other devices if sync push is set up
  • Mobile Analytics:
    • Collects, analyzes, visualizes, and understand the apps
    • Generates reports for users, sessions, in-app revenues, and events
    • Filters reports by data range and platform
  • Amazon S3:
    • Mobile apps can directly access Amazon S3 to store data
    • Provides Transfer Utility/Transfer Manager (Older Version) to consume S3 services
  • DynamoDB:
    • SDK contains a high-level library to access and work with DynamoDB Object Mapper
    • Can perform CRUD operations such as Create, Read, Update, and Delete for client-class
  • Amazon Kinesis:
    • Provides simple, high-level design
    • Stores real-time data on disk and sends it all together to save battery life
  • Lambda:
    • Lambda function receives app and device data to create a personalized and rich app experience
  • Amazon Lex:
    • You can integrate a chat box on mobile devices
  • Amazon Polly:
    • Mobile SDK provides add text to speech integration for Amazon Polly
  • Amazon Pinpoint:
    • Integrates Amazon Pinpoint to send push notification campaigns from Android apps
Currently, Android 2.3.3 (API level 10) or higher can use AWS Mobile SDKs.

Now let's understand how to set up the AWS Mobile SDK and then we will see an example with Amazon S3.

The AWS Mobile SDK is available at the following two resources for download:

This SDK includes class libraries, code example, and documentation:

  • Class libraries will include the Java Archive Files (.jar) files for the AWS services. You can include the class for the service which you are using in your applications.
  • The code example provides you with an example of using the service in your application using class libraries.
  • Documentation is reference material for the use of AWS Mobile SDK for Android.
AWS Secure Token Service ( STS) and Amazon Cognito Identity are bundled with the AWS Mobile SDK core library. You will get a compile-time error if you include it as a separate JAR file.

In the next section, you will see how to set up AWS Mobile SDK for Android.