Search code examples
androidandroid-architecture-componentsandroid-jetpackandroidx

Android Library Module using Architectural Components, without changing the main app module?


I was thinking of migrating our legacy code to Android Architectural Components. But, it's a huge project and it will take lots of time, with impact on business, if I plan to migrate all at once.

But, as it's a Multi Module project. I have some queries:

  1. Can I change some modules to Android Architectural Components without affecting the main module ?
  2. Is it possible to change some modules to Android Architectural Components using Kotlin ?

Need your suggestions.


Solution

  • For both the question's answer is yes. Android Architectural Components

    1. some modules to Android Architectural Components you can use the component's in any module specifically without effecting any other module of your project example you can use Live Data only between few Fragment's of the module. similarly you can use ViewModel only in one Activity so Android Architectural Components is totally independent of the Module it can be used even only in a part of module also based on the need as i am using it in my project.
    2. some modules to Android Architectural Components using Kotlin as Android Architectural Components are supported both by Java and Kotlin so need to worry about that you can use it anyway Java or Kotlin