title: DynamoDB List type
body: <p>I have problems understanding how to create a List for dynamoDB from my Android app.
  I can store and load the <code>{
    "deviceId": "920e185a-63ed-46ca-bfca-f7a484ccb708"
  }</code> from my app. But then to add the List and store my JSON objects as Map in the List is were i struggle.</p>
  
  <p>The dynamoDB structure I want to create and populate looks like this in a JSON format:</p>
  
  <p><code>{
    "data": [
      {
        "heartBeatId": 1,
        "status": 1,
        "timeStamp": 1502183502711
      },
      {
        "heartBeatId": 2,
        "status": 1,
        "timeStamp": 1502183502812
      }
    ],
    "deviceId": "90563daa-63ae-40c5-905e-9e8c02f9624f"
  }
  </code>
  Then I want to populate the data List with the heartbeat object which is of Map type.
  <code>{
    "heartBeatId": 2,
    "status": 1,
    "timeStamp": 1502183502812
  }</code>
  So im having problems defining the <code>@DynamoDBTable(tableName = "heartbeat")</code> class to create this structure.</p>
  
  <p>I have been reading about the List and DynamoDBDocument here:</p>
  
  <p><a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.Annotations.html#DynamoDBMapper.Annotations.DynamoDBDocument" rel="nofollow noreferrer">DynamoDBDocument</a></p>
  
  <p><a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes" rel="nofollow noreferrer">DataType List</a></p>
  
  <p>This how the <code>@DynamoDBTable(tableName = "heartbeat")</code> class looks right now.</p>
  
  <p>I hope someone can help me define it or give me clues on how to proceed getting the structure i need.</p>
  
  <pre><code>package com.example.android.awsdynamoapp;
  
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBAttribute;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBDocument;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBHashKey;
  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBTable;
  
  import java.lang.annotation.Annotation;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  @DynamoDBTable(tableName = "heartbeat")
  public class HeartBeat implements DynamoDBTable {
  
  private String deviceId;
  private Map&lt;String, Integer&gt; data;
  private List dataList;
  
  public HeartBeat(){};
  public HeartBeat(String deviceId){this.deviceId = deviceId;};
  
  public HeartBeat(String deviceId, List dataList) {
      this.deviceId = deviceId;
      this.dataList = dataList;
    //  this.timeStamp = timeStamp;
  }
  
  @DynamoDBHashKey(attributeName = "deviceId")
  public String getDeviceId() {
      return deviceId;
  }
  
  public void setDeviceId(String deviceId) {
      this.deviceId = deviceId;
  }
  public void setTimeStamp(String timeStamp) {
      //this.timeStamp = timeStamp;
  }
  
  
  public void setData(String deviceId) {
      Map&lt;String, Integer&gt; data = new HashMap&lt;&gt;();
  
  }
  
  @DynamoDBAttribute(attributeName = "data")
  public List getData() {
      return this.dataList;
  }
  
  @DynamoDBDocument
  public static class JsonArray {
      private String heartBeatId;
      private String status;
      private String timeStamp;
  
  }
  
  /**
   * The name of the table to use for this class.
   */
  @Override
  public String tableName() {
      return "heartbeat";
  }
  
  @Override
  public Class&lt;? extends Annotation&gt; annotationType() {
      return null;
  }
  }
  </code></pre>