bellotas
bellotas

Reputation: 2461

How to reuse an Android project to have two different APK

I have previously worked on a project using Android Studio. Now I want to start a new project, but with similar characteristics, so instead of re-starting the project, I have copy the folder, changing the name and made few functionalities.

Nevertheless, when I have built the APK, and tried to reinstall it, my device prompt the following message:

Do you want to install an update to this existing application? Your existing data will not be lost

Before pressing accept, I would like to know if this is going to remove the application that I had in my device with the first project that I was working with or not. If so, I would like to know how to do it, or at least how to avoid this issue.

I assume that it could be done by changing the id of the project, or any other simple solution, but it would be nice to double check

Upvotes: 0

Views: 164

Answers (1)

Perraco
Perraco

Reputation: 17360

You need to change the application id (package name). Android uses such value to uniquely identify each existing app.

Every Android app has a unique application ID that looks like a Java package name, such as com.example.myapp. This ID uniquely identifies your app on the device and in Google Play Store. If you want to upload a new version of your app, the application ID (and the certificate you sign it with) must be the same as the original APK—if you change the application ID, Google Play Store treats the APK as a completely different app. So once you publish your app, you should never change the application ID.

Upvotes: 1

Related Questions