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.
Imagine the following data that we want to add to a message's meta payload:
To store this in Android we would need to do the following:
You can also use the HashMapHelper
class to convert between these two representations:
You can then flatten the map:
This yields:
You can also expand the map:
Which yields:
Last updated