我面临的问题是有两个类似的项目(应用程序),将来还会有更多,当我更改一个代码时,我需要在其他项目中进行相同的更改。当我在网上搜索时,我找到了产品口味,但不确定这是否是我问题的答案。
如何在 Playstore 中合并两个不同的项目(应用程序)。项目代码是 %85 相似,我可以使用风格将两个项目合并为一个,我是否能够使用具有不同包名称和一些不同权限的不同 jks 在 Playstore 中更新它们。我是否需要每种口味的 AndroidManifest 文件。
我怎么解决这个问题。谢谢
要更改 packageName,您必须创建产品风味,例如
flavorDimensions "versionCode"
productFlavors {
doctorApp {
dimension "versionCode"
applicationId "com.doctor.app"
}
patientApp {
dimension "versionCode"
applicationId "com.patient.app"
}
}
之后在将项目视图切换到项目后创建主的两个兄弟文件夹
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
在患者应用程序和医生应用程序下创建相同的package name
和res folder
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句