I'm creating the chat app, and wondering to know what the best way to handle situation when will be added key to a node in the json
table, and pre versions of the application with old Class
represents the node(with less variables) will be crashed.
For example:
mChatUser = childDataSnapshot.getValue(ChatUser.class);
In table ChatUser node have 4 String keys, as well as, ChatUser.class
has 4 String variables, it is ok. But after we update ChatUser
nodes to have 5 variables and ChatUser.class
to have 5 variables, but app still not updated to all devices, so in old versions will be crash. How to avoid it? And best way to add keys?
Thanks.