android-architecture

How to share dependencies in a Modularized Android App

戏子无情 提交于 2019-12-05 03:59:05
I have an Android project which is architectured in a Modularized way. I have modularized the projects by dividing their source code between multiple Gradle modules, following the clean Architecture . Here is the structure of the App. The top module in this hierarchy, App is the one that no other module depends upon, is the main module of your application. The lower level modules domain and data do not depend on the App module, where the App module includes the data and domain modules. I have added the below code in the build.gradle of the app module implementation project(':domain') api

BoundService + LiveData + ViewModel best practice in new Android recommended architecture

本小妞迷上赌 提交于 2019-12-02 19:10:50
I been struggling a lot thinking about where to place Android Services in the new Android recommended Architecture . I came up with many possible solutions, but I cannot make up my mind about which one is the best approach. I did a lot of research, and I couldn't find any useful guideline nor tutorial. The only hint I found about where to place the Service in my app architecture is this one, from @JoseAlcerreca Medium post Ideally, ViewModels shouldn’t know anything about Android. This improves testability, leak safety and modularity. A general rule of thumb is to make sure there are no

Androidx and databinding

∥☆過路亽.° 提交于 2019-11-29 09:34:37
I'm migrating my dependencies for an Android P test to the androidx dependencies. For some not very clear reasons my project does not compile anymore (and no I won't provide the details to avoid a distinct problem). I found out (via gradlew dependencies ) that the databinding uses the "oldschool" dependency android.arch.lifecycle:runtime:1.0.3 instead of androidx.lifecycle:lifecycle-runtime:2.0.0-beta01 . I guess that could be one reason. Any idea how to force using the new package names/dependencies? Enabling AndroidX in the gradle.properties fixed this problem for me: android.useAndroidX

Androidx and databinding

你。 提交于 2019-11-28 02:52:06
问题 I'm migrating my dependencies for an Android P test to the androidx dependencies. For some not very clear reasons my project does not compile anymore (and no I won't provide the details to avoid a distinct problem). I found out (via gradlew dependencies ) that the databinding uses the "oldschool" dependency android.arch.lifecycle:runtime:1.0.3 instead of androidx.lifecycle:lifecycle-runtime:2.0.0-beta01 . I guess that could be one reason. Any idea how to force using the new package names