I have my own mobile app aka modul. The second mod...
# compose-wear
y
I have my own mobile app aka modul. The second modul is wear. I wrote UI in wear modul but I don’t know how to connect to wear modul to app modul for usecases sharing. Can somebody point me on some sources? I tried github, medium, google, documentation, YT, and I still can’t find a good source for the correct connection of the wear module to the mobile app module where I have already written usecases. It’s simple app aka weather app.
a
You should have (at least) a third module (for your use cases) upon which the app module and the wear module depend.
The app and wear modules should not depend on one another.
y
Yes. I can make core module with the use cases. But please do you have some advice for good source of tutorials or something like this?
a
Do you mean for how to structure overall or how to extract code from existing modules?
y
For example if it's help me to connect correctly wear modul to other one
y
I can't remember the names, but two handsome smart gentlemen gave a talk on this exact topic at ADS.

https://youtu.be/w3KvfvgUIds

y
this your nice and great video I’ve seen that before. Unfortunately, it’s only theoretical for me. I guess I’m not very smart. I’m looking for a practical guide. 1 module with an application for obtaining data, e.g. about free parking spaces. 1. the wear module gets data from the core (or app) module and just displays it.
I don’t want to write the same logic in the wear application and the same in the mobile application module
a
Can you start by moving logic to a core module?
y
yes .. no problem
y
Maybe, work through this example https://github.com/android/wear-os-samples/tree/main/DataLayer can be a help, if you are asking for exchanging data between the two devices. This link can also be a help https://developer.android.com/training/wearables/data/data-layer, there used to be some good codelab for DataLayer in the past for java.
y
Thank you so much all of them guys. Looking forward to this nice adventure 😍