-1

The problem i am facing is there is two project(apps) similar and there will be more in future and when i change a code in one i will need to do same changes in other projects. when i searched on web i found product flavors but not sure if it's the answer for my problem.

How can i merge two different projects (apps) in playstore. Projects codes are %85 similar can i use flavors to merge both project in one and will i be able to update them in playstore using different jks with different package names and a few different permissions. Will i need AndroidManifest file for each flavor.

How can i solve this problem. Thanks

mephisour
  • 53
  • 4
  • See https://stackoverflow.com/questions/36194748/different-keystore-for-different-product-flavors-in-gradle Another option might be to move the common code to a library project which you then use in both apps. – Michael Aug 17 '20 at 10:25
  • @Michael hi thanks for the answer do you know if it will be enough to update app using its applicationId or does google playstore need something else in the new flavor based project – mephisour Aug 17 '20 at 10:44

1 Answers1

0

To change packageName you have to create product Flavor like

flavorDimensions "versionCode"

productFlavors {

    doctorApp {
        dimension "versionCode"
        applicationId  "com.doctor.app"

    }
    patientApp {
        dimension "versionCode"
        applicationId  "com.patient.app"
    }
}

After that create two sibling folder of main after switch project View to Project

app -> src -> main       /// write all common classes here
app -> src -> doctorApp  // doctor related classes here along with their resources
app -> src -> patientApp // patient related classes here along with their resources

create same package name and res folder under patientApp and doctorApp

Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300