英文:
Build Multiple apk from 1 project, for upload in playstore
问题
我正在使用Java在Android Studio上开发一款学校应用程序。
我希望能够为每个学校生成带有学校名称和标志的多个APK文件(大约50+所学校)。
是否有办法节省时间,一次性生成所有的APK文件,
以便将来需要更新全部内容。
英文:
I am working on a app for school in android studio using java
I want to generate multiple apk for school with their school name and logo, (about 50+ schools)
Is there any way to save time generating one by one
in future need to update all
答案1
得分: 0
阅读关于productFlavors
的官方指南。
> 创建产品风味与创建构建类型类似:将它们添加到构建配置的productFlavors块中,并包含所需的设置。产品风味支持与defaultConfig相同的属性,这是因为defaultConfig实际上属于ProductFlavor类。
productFlavors {
elvispresley {
applicationId 'your_package_id'
versionCode 1
versionName '1.0'
}
whitneyhouston {
applicationId 'your_package_id_2'
versionCode 2
versionName '2.0.1'
}
projectOne {
applicationIdSuffix ".one"
}
projectTwo {
applicationIdSuffix ".two"
}
}
英文:
Read official guideline about productFlavors
.
> Creating product flavors is similar to creating build types: add them
> to the productFlavors block in your build configuration and include
> the settings you want. The product flavors support the same properties
> as defaultConfig—this is because defaultConfig actually belongs to the
> ProductFlavor class.
productFlavors {
elvispresley {
applicationId 'your_package_id'
versionCode 1
versionName '1.0'
}
whitneyhouston {
applicationId 'your_package_id_2'
versionCode 2
versionName '2.0.1'
}
projectOne {
applicationIdSuffix ".one"
}
projectTwo {
applicationIdSuffix ".two"
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论