Reputation: 7
I'm practising Android Program with a book
and it says if the package name is same, android understand it's same app even if the project is different.
so, I changed it with Refactor.
and it also says if you want to change app package name too, then please change the application ID in build.gradle
(Module:app)
what is the difference between Package name & App Package Name?(Maybe the name is wrong because I just translate it.)
Upvotes: 0
Views: 1104
Reputation: 364
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.
android {
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
...
}
Although your project's package name matches the application ID by default, you can change it. However, if you want to change your package name, be aware that the package name (as defined by your project directory structure) should always match the package attribute in the AndroidManifest.xml file, as shown here:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
Upvotes: 1