0

below is my JSON Structure of Firebase Database.

JSON Database Structure

From above data, I want to join Users and Posts using authorId how can I merge this two schema into one and add them to recyclerview.

AL.
  • 36,815
  • 10
  • 142
  • 281
Techierj
  • 131
  • 9
  • For an example of joining data with FirebaseUI, see http://stackoverflow.com/questions/34559171/coupling-firebaserecyclerviewadapter-to-a-boolean-string-map-entry – Frank van Puffelen Apr 16 '17 at 09:57
  • Hi @FrankvanPuffelen Thanks for comment, I also wanted to know Is it ok to use **DatabaseReference** _inside_ populateViewHolder()? Is it **best practice**? If yes, then what if I have more than one key ref in JSON Schema, Do I need to create **DatabaseReference for each** of those to get their respective value in populateViewHolder(), will it affect recycler view's performance? – Techierj Apr 16 '17 at 13:32
  • Everything you do affects performance. Yes, you will need to load each item separately. That is not as slow as you may think. See http://stackoverflow.com/questions/35931526/speed-up-fetching-posts-for-my-social-network-app-by-using-query-instead-of-obse/35932786#35932786 – Frank van Puffelen Apr 17 '17 at 01:47

0 Answers0