> For the complete documentation index, see [llms.txt](https://chat-sdk.gitbook.io/android/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chat-sdk.gitbook.io/android/api/handling-structured-meta-data.md).

# Handling Structured Meta Data

In Android, the ORM we use (GreenDAO) can’t store arrays or maps. It can only store key, value pairs. The ORM we use for iOS (CoreData) on the other hand can store maps and dictionaries. That means that to store structured data for Android we need to take another approach.&#x20;

Imagine the following data that we want to add to a message's meta payload:&#x20;

```
{
    key1: {
        sub1: “a”,
        sub2: “b”
    },
    key2: “c"
}
```

To store this in Android we would need to do the following:&#x20;

```java
message.setValueForKey(“a", "key1/sub1”);
message.setValueForKey(“b", "key1/sub2");
message.setValueForKey(“c", "key2");
```

You can also use the `HashMapHelper` class to convert between these two representations:&#x20;

```java
Map<String, String> sub = new HashMap<String, String>() {{
            put("sub1", "a");
            put("sub2", "b");
        }};
Map<String, Object> map = new HashMap<String, Object>() {{
    put("key1", sub);
    put("key2", "c");
}};
```

You can then flatten the map:

```java
Map<String, Object> flat = HashMapHelper.flatten(map);
```

This yields:

```java
{
  key2=c, 
  key1/sub2=b, 
  key1/sub1=a
}
```

&#x20;You can also expand the map:

```java
Map<String, Object> expanded = HashMapHelper.expand(flat);
```

Which yields:

```java
{
  key2=c, 
  key1={
    sub1=a, 
    sub2=b
  }
}
```
