https://kotlinlang.org logo
#android
Title
# android
t

Travis Griggs

11/06/2023, 10:22 PM
I am doing a rewrite of an existing app. Said app has a package name that the play store knows it as as com.mycompany.xyz. So some day, I want this app to replace that app (be the new version) with the same package name. But during development, I want to be able to install both on the same phone. What is the best strategy for that? Make my package name from the new project be com.mycompany.xyz2 for now, but then in the future, is there an easy way to change that for an exsiting app when I'm ready to repace the old with it?
not kotlin but kotlin colored 1
f

Frank Bouwens

11/07/2023, 10:16 AM
not kotlin but kotlin colored But, let me give you a pointer anyway; You could take a look at ProductFlavors https://developer.android.com/build/build-variants Using ProductFlavors, you can have the Release and Debug versions of your app use different package names, and therefor have both versions installed on the same device. In your case; This would mean you can a debug-version of your new app, and the release version of the old app installed at the same time. If you need release versions of both your old and new app installed at the same time; You can add another ProductFlavor to the new app, with another package name (
applicationIdSuffix
); Hope this helps! Good luck!
t

Travis Griggs

11/07/2023, 4:41 PM
Thank you. I did try to sign up for the "other channels" mentioned (at least the two slack ones) and the invites weren't even acked. Maybe the discord one is active, dunno. just felt like i was being told go hang out in /dev/null. So again, thanks for helping a fellow out. I really appreciate it.
And indeed, it did help. Was able to use a flavor to make my "next" version coexist with the current one. Like a charm.
👍 1
f

Frank Bouwens

11/07/2023, 10:47 PM
Glad you could make it work 😉 !