I have two Android projects in Eclipse. I copied the one project from the other, then changed the app name (in strings.xml) and the project name
The most simple way I have found to accomplish this task is to utilize Product Flavor in .gradle
productFlavors {
MainApp {
applicationId = "com.company.app"
}
NewAppFlavor {
applicationId = "com.company.newapp"
}
}
buildTypes {
debug {
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + getDateAsMillis() + "L)"
applicationIdSuffix ".debug"
}
}
You then specify package name in AndroidManifest.xml as
Upon release configuration, Android Studio (1.5.1 as of this writing) will ask which flavor to build.
Debug configuration is a little less intuitive, you must hover the cursor over the bottom left corner of the screen, select "Build Variants" and select which flavor your debug configuration will deploy when you press the play button.