Android Studio “mobile” and “wear” project modules, shared components location

前端 未结 1 1950
面向向阳花
面向向阳花 2021-01-13 14:02

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

相关标签:
1条回答
  • 2021-01-13 14:24

    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.

    0 讨论(0)
提交回复
热议问题