To explain my question with a sample: I have a list view in which I need to display a person's id and name. Ids are stored locally in SQLite and I need to get the corresponding names from Firebase. What is the best approach in this case? If the Ids and Names were both from Firebase, then Firebase UI would be the answer but what would be the best way for my use case of "looking up" data, since synchronous queries are not possible with Firebase?
The way I'm doing right now is using addListenerForSingleValueEvent
to populate a Hashmap
with the dataSnapshot
and use the Hashmap for subsequent lookups. This way I think I can avoid too many network requests. Is this ideal?
I do use persistence and keepSynced(true)
with this approach, but my question is specifically w.r.t. "looking up" data and avoid using an extra Hashmap.