5

In my Android Studio project there are two android modules "mobile" and "wear", these seem to be the views and controllers for the types of android devices that will be able to run this application

I expect them to share some logic, such as the model files and POJOs so where should that be stored? I expect the "mobile" module to do a lot more heavy lifting than the "wear" module, but should I put the model objects in that module, or should I make a new third module that they can both use? (or some other design paradigm)

CQM
  • 42,592
  • 75
  • 224
  • 366
  • Hi, is there some argument why my answer wasn't accepted? I think it solves this question. Regards. – Michał Tajchert Dec 26 '14 at 22:22
  • @Tajchert well the edit is much more helpful, and you just did it, 4 months later..... – CQM Dec 26 '14 at 23:41
  • Sorry for that, now I wrote it in more clean way, and added some additional info that I wasn't sure 4 months ago (assets). Sorry for that if first time it wan't helpful for you. – Michał Tajchert Dec 26 '14 at 23:48

1 Answers1

13

Take a look there: https://github.com/tajchert/SWear_Weather

I created common module that (in my case) have constant variables, and is shared between phone and Wear module.

About where to put your objects... if you expect to use same objects on Wear an mobile, put them in common project so they are automatically shared between those two (no code duplication), but if particular object is used only on mobile and there is no need in future to add him on Wear, just put him in mobile project.

Also common project can allow you to share stuff like assets (icons etc.) between mobile and Wear device.

Michał Tajchert
  • 10,333
  • 4
  • 30
  • 47