Book Image

DynamoDB Cookbook

By : Tanmay Deshpande
Book Image

DynamoDB Cookbook

By: Tanmay Deshpande

Overview of this book

Table of Contents (18 chapters)
DynamoDB Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing add new contact services


In this recipe, we are going to see how to implement and add new contacts services to our Android app.

Getting ready…

To get started with this recipe, you should have performed the earlier recipes.

How to do it…

To save contacts against a specific user, we will use the ContactApp table, which we created earlier:

  1. First of all, we need to define a model that we will use for various contact services. Here is our contact model:

    @DynamoDBTable(tableName = Constants.CONTACT_TABLE)
      public static class AppContact {
        private String id;
        private String email;
        private String name;
        private String phone;
        private String parentId;
        public String getEmail() {
          return email;
        }
        public void setEmail(String email) {
          this.email = email;
        }
        @DynamoDBAttribute(attributeName = "name")
        public String getName() {
          return name;
        }
        public void setName(String name) {
          this.name = name;
        }
        @DynamoDBHashKey(attributeName...