copying an android studio project and run two versions on smartphone

548 views Asked by At

I have copied an Android Studio project and changed the name. It builds and I can run it on the Samsung. But it replaces the original version instead of installing itself as a new app on the phone. It just changes the name of the app on the phone. Is there another setting I have to change?

4

There are 4 answers

0
kamel sabri On

If you're using Gradle, you can change it from your app.gradle under "android" section -> "defaultConfig" -> "applicationId"

0
Nithinlal On

The package name is the unique identifier for an android application.There can't be two apps with the same package name in the market/on the device There is a good article about it here

You can use Flavours for run two versions on smartphone. For reference please go to the below link

https://developer.android.com/studio/build/build-variants.html

http://blog.brainattica.com/how-to-work-with-flavours-on-android/

0
ajantha On

In android studio right click on your project. Open Module Settings-> Flavors Tab There change the Application Id to different one to take new apk with the same code.

0
Ciril On

No need of another copy of application just change the package name in Manifest file

package="com.example.myapplication"

Take a build with one package and another build with changed package name

like package="com.example.myapplication2"