[英]How to connect firebase if I have multiple modules in my android native app
I am working on my Final year project, which is an android native app, using Kotlin.我正在使用 Kotlin 进行我的最后一年项目,这是一个 android 本机应用程序。 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 ie auth module, resources module, etc. I am confused about this I think this would be really hard to maintain.
我的问题是如何将 firebase 与所有模块连接我是否需要在每个模块中复制 JSON 文件以及在每个模块中添加所有必需的依赖项,即身份验证模块、资源模块等。我对此感到困惑我认为这会真的很难维护。
Please give me some best suggestions on how to handle multi-module project effectively请给我一些关于如何有效处理多模块项目的最佳建议
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.无需在每个模块中添加依赖项,让我们将所有与 firebase 相关的处理保留在单独的
firebase
模块中,并将该模块添加到主app
模块中。 From app
module you can simply call the implementation in firebase
module and make it work.从
app
模块中,您可以简单地调用firebase
模块中的实现并使其工作。
PS: please make sure the project you are gonna develop has to be multi-module. PS:请确保您要开发的项目必须是多模块的。 Not every app needs to develop on multi-module approach IMO.
并非每个应用程序都需要在多模块方法 IMO 上开发。
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.由于您已经拥有一个多模块 Android 应用程序,因此您肯定必须拥有一个基础\/核心模块,所有其他模块都必须依赖于该模块。
There are 2 things you can do你可以做两件事
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.