In Android Studio creating an Android Wear project, how can I include the same file in both modules

I successfully create an Android Wear face and a connected app on a mobile device. The problem is that I have several resource files and classes that are referenced both in modules mobileand wear. The skeletal application I built it from also created a module (not a building one) DigitalWatch, and I guess I could move these common files there and then reference them from my Gradle build files. I looked at some ideas on Stackoverflow, but comments suggest that they don't work.

Here is my project structure. Regular files include res / strings.xml, a utility class, and google json files.

Project structure

+4
1

Java / "Common" , gradle

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':common')
    ...
}

, java , xmlns:app="http://schemas.android.com/apk/res-auto" .

google-services.json , Google .

+6

Source: https://habr.com/ru/post/1629064/


All Articles