Amplify Android simplifies integrating AWS services into Android apps, making it easier to add features like authentication, data storage, and real-time updates without lots of code. This user-friendly interface not only cuts down on complexity but also speeds up the development process. With Amplify Android, developers get tools that make setup straightforward, provide detailed documentation, and support advanced capabilities like offline data sync and GraphQL. This means you can spend less time dealing with the technicalities of cloud integration and more time crafting engaging user experiences. Choosing Amplify Android could lead to quicker development, plus applications that are both scalable and secure.
Notes:
-
Drop-in Auth provided by
AWSMobileClient
is replaced with Authenticator UI component. Additionally, Authenticator UI component does not support social providers yet. You can track updates on it here. -
To manually refresh the ID and access tokens (such as in scenarios where you might need to ensure that you have the latest tokens, perhaps because of changes in permissions or other security-related updates) refer to Amplify docs
-
Amplify Sign In's will handle token refreshing as long as the refresh token is valid. Amplify does not support refreshing tokens automatically through
federateToIdentityPool()
.
AWS SDK For Android | Amplify Android |
---|---|
Upload File | Upload File |
Download File | Download File |
Track Progress | Track Progress Download |
Pause/Resume/Start/Cancel | Pause/Resume/Start/Cancel |
Long-running Transfers | Amplify supports this by default |
Transfer with Metadata | Transfer with Metadata |
Transfer Network Connection Type | Amplify does not support this for now |
AWS SDK For Android | Amplify Android |
---|---|
Basic Operations | Create, Fetch, Update, Delete |
IAM Authorization | IAM Authorization |
Cognito User pool Authorization | Cognito User pool Authorization |
AWS SDK For Android | Amplify Android |
---|---|
Setup, Push Notification Service Setup | Setup, Push Notification Service Setup |
Register Device | Register Device |
Record Notification Events | Record Notification Events |
AWS SDK For Android | Amplify Android |
---|---|
Manually Track Session | Automatically Track Session |
Add Analytics | Add Analytics |
Authentication Events | Authentication events |
Custom Events | Custom Events |
Monetization events | Please Check Notes |
Notes:
- For recording events:
When migrating from the AWS SDK for Android to Amplify, you'll need to adjust your approach to handle user sessions, as the two libraries have different mechanisms for managing user authentication and session management.
- Use
Amplify.Analytics.recordEvent()
for recording Monetization event.
// Example:
val PURCHASE_EVENT_NAME = "_monetization.purchase"
val PURCHASE_EVENT_QUANTITY_METRIC = "_quantity"
val PURCHASE_EVENT_ITEM_PRICE_METRIC = "_item_price"
val PURCHASE_EVENT_PRODUCT_ID_ATTR = "_product_id"
val PURCHASE_EVENT_PRICE_FORMATTED_ATTR = "_item_price_formatted"
val PURCHASE_EVENT_STORE_ATTR = "_store"
val PURCHASE_EVENT_TRANSACTION_ID_ATTR = "_transaction_id"
val PURCHASE_EVENT_CURRENCY_ATTR = "_currency"
val event = AnalyticsEvent.builder()
.name(PURCHASE_EVENT_NAME)
.addProperty(PURCHASE_EVENT_PRODUCT_ID_ATTR, productId)
.addProperty(PURCHASE_EVENT_STORE_ATTR, store)
.addProperty(PURCHASE_EVENT_QUANTITY_METRIC, quantity)
.addProperty(PURCHASE_EVENT_PRICE_FORMATTED_ATTR, formattedItemPrice)
.addProperty(PURCHASE_EVENT_ITEM_PRICE_METRIC, itemPrice)
.addProperty(PURCHASE_EVENT_TRANSACTION_ID_ATTR, transactionId)
.addProperty(PURCHASE_EVENT_CURRENCY_ATTR, currency)
.build()
Amplify.Analytics.recordEvent(event)
- Amplify Analytics events have default configuration to flush out to the network every 30 seconds. This interval can be configured in
amplifyconfiguration.json.
Refer Flush Events section in Amplify Documentation for more details. - Limits applicable to ingestion of events for Amazon Pinpoint can be found here.
Notes:
- For AWS IoT, we recommend using AWS SDK for JAVA