I know this has been asked before but I haven't seen a working solution. I have two android studio (V 3.1.3) projects, MyAppBasic and MyAppPro. They each have 3 modules in common and one that is unique. My current implementation is duplicating the 3 common modules in each project. Obviously this is undesirable. What is the recommended way to implement these two apps and avoid code duplication? Thanks.
Asked
Active
Viewed 115 times
1 Answers
1
In case both of your project: MyAppBasic and MyAppPro, have almost a similar code, you can merge them and use build variant to differentiate between basic and pro app.
You also need to installing each module as a local library by using Gradle Android Maven plugin (you can see this answer for details: https://stackoverflow.com/a/33736043/4758255). Then you only need to maintain 3 common modules which is reusable as the libraries for both of your projects.

ישו אוהב אותך
- 28,609
- 11
- 78
- 96
-
I'll check out those links later today. Are "flavors" involved? – Phil O Jun 23 '18 at 13:47
-
Yes, it's involved – ישו אוהב אותך Jun 23 '18 at 13:53