Can we have multiple apps in one Android Studio project?

前端 未结 5 1191
小蘑菇
小蘑菇 2020-12-07 14:07

I am using Android Studio for developing Android apps. But I have heard in Android Studio it is better to have only one app in a single (one project per app) if that is righ

5条回答
  •  萌比男神i
    2020-12-07 14:41

    Yes, it is possible. As the existing answers showed, it’s quite straightforward to create additional application module in the same Android Studio project. So I’ll try to answer underlying question why anyone might need it.

    It’s certainly not worth it to put multiple completely independent apps in one project.

    However, if you app is big enough, you might benefit from putting separate features into separate modules. You can also create a separate executable app module for each feature, so that you can:

    • launch/debug each feature separately
    • save some time on every compilation/dexing/putting everything into a single apk
    • encourage teams/developers to work independently, and even in separate repositories.

    The main app module can be used only to combine existing features together.

    I’ve recently created an article demonstrating this approach where I tried to explain everything in more details: https://medium.com/@domplebump/multiple-application-modules-in-one-android-project-36e86ceb8a9

提交回复
热议问题