skip to Main Content

I am working on my Final year project, which is an android native app, using Kotlin. my question is how to connect firebase with all modules do I need to copy the JSON file in every module as well as add all the required dependencies in every module i.e. auth module, resources module, etc. I am confused about this I think this would be really hard to maintain.

Please give me some best suggestions on how to handle multi-module project effectively

2

Answers


  1. No need to add dependency in each and every module, let’s just keep all the firebase related handling in separate firebase module and add that module in main app module. From app module you can simply call the implementation in firebase module and make it work.

    PS: please make sure the project you are gonna develop has to be multi-module. Not every app needs to develop on multi-module approach IMO.

    Login or Signup to reply.
  2. As you are already having a multi module Android app, so you definitely must be having a base/core module on which all the other modules must be depending on.

    There are 2 things you can do

    1. Add a common wrapper class where are firebase related code is present into your base module and then access the same across different modules.
    2. Use api instead of implementation in your build.gradle file while adding firebase dependancy. This way you will get access to Firebase across all the modules which depend on your base/common module.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search