Search code examples
firebasefirebase-realtime-databaseandroid-architecture-components

Firebase with architecture components


I am looking for advice on how to use android architecture components and firebase.

I am new to android programming and I've heard of architecture components and how it makes it easy for beginners to get started with android. I am using firebase realtime database as my backend.

Should I place the database calls like addListenerForSingleValueEvent in the repository class or its okay if I use it inside my activities and fragments?

I have searched for guidance on how to use firebase with the android architecture components but haven't found any. Any best practices on how I can use firebase with architecture components?


Solution

  • Have you taken a look at this Firebase Blog post Using Android Architecture Components with Firebase Realtime Database