Items filtered by date: September 2018

Android and DynamoDB

android dynamodb

DynamoDB

Amazon DynamoDb is a nonrelational database that is fast and flexible. It is a NoSQL database service with consistent, single-digit millisecond latency at any scale. DynamoDB is a managed cloud database supporting both document and key-value store models

You can use DynamoDB in your Android apps.

Android and DynamoDB: The two options

DynamoDB Object Mapper API

Using the DynamoDB Mapper API you would define a model in your app matching the model of your DynamoDB table. You then use the DynamoDBMapper class as the entry point to DynamoDB to access your data.

Document API

The Document API lets you access the individual attributes within data objects directly. You don’t have to map the DynamoDB table properties to your apps’ class members. The Document API acts as an interface between your app and the returned data.

The Document API has new data types to assist in the serialization and deserialization process.

So what’s the difference?

Both APIs have methods enabling you to perform create, update and delete operations as well as executing queries on your DynamoDB tables.

The difference between the two APIs is how the data is represented in your app. You can choose which API to use and you can even mix and match the two depending on your needs.

This tutorial uses the Document API to interact with our DynamoDB table.

Android and Amazon integration

android S3

Amazon S3 is a cloud storage service where you can store any number of objects from anywhere on the internet. We’ll use S3 in this tutorial to store an image uploaded from our Android app and then download and display the image in our app.

Cognito is a sign-up, sign-in, and access control service. We’ll use it in this tutorial to control access to our S3 images. We’ll only allow signed-in users to upload images to our S3 bucket while both signed-in and guest users will be able to download images.

Want to add sign-in to your Android app?

AWS Cognito User Pool Android app sign-up, sign-in security 

You can add sign-in using the Google API but there is an alternative. You can use Amazons’ Cognito, “Simple and Secure User Sign-Up, Sign-In, and Access Control. Amazon Cognito lets you add user sign-up, sign-in, and access control to your web and mobile apps quickly and easily. Amazon Cognito scales to millions of users and supports sign-in with social identity providers, such as Facebook, Google, and Amazon, and enterprise identity providers via SAML 2.0.”

We’ve created a series of quick and easy tutorials showing you how you can add sign-up and sign-in to your Android up using Cognito. Here’s the first of the series, check it out:

In Cognito we trust

login form.jpg

Need to control your web or mobile app users sign-up and log-in and what they can do once they’ve logged in? Have you considered using Amazon’s Cognito?

What’s Cognito?

Cognito is an Amazon Web Service that enables you to sign-up your users, allow them to log in and then control what they can do once they’ve logged in to your web or mobile app. Your users can also make use of Social Identity providers such as Facebook and Twitter to log in. It’s free to use under AWS’s free tier option after which the rates are very reasonable as you pay only for what you use.

There are two components to Cognito:

  • User pools which saves your user profile attributes, providing sign-up and sign-in options for them
  • Identity pools which grant users access to other AWS services

You can use the two options separately or together.