As you see in the JSON below, I want to represent all the countries in the world. For Firebase de-serialization, I started creating classes like Germany.java
, Italy.java
, but then it hit me, I have to write 249 classes and in Android when it comes to memory and resource use, what is the best way to do this? Of course I will never initialize more then one at the time.
Was thinking maybe Firebase can do this work, but then I must pay money for that. Was thinking maybe the User's device can download the country he needs, but it might cost me some.
"LK": {
"name": "Sri Lanka"
},
"SD": {
"name": "Sudan"
},
"SR": {
"name": "Suriname"
},
"SJ": {
"name": "Svalbard and Jan Mayen"
},
"SZ": {
"name": "Swaziland"
},
"SE": {
"name": "Sweden",
"ADMINISTRATIVE_AREA_LEVEL_1": {
"Stockholms län": {
"LOCALITY": {
"Stockholm": {
"STREET_ADDRESS": {
"Björngatan 36": {
"id": "KQqv0SYDBP_DMTtJupC",
"path": "SE/ADMINISTRATIVE_AREA_LEVE...",
"somekey": ".....",
}
}
}
}
}
}
},