Abdul Rahman Majeed
Abdul Rahman Majeed

Reputation: 1135

what is difference between Package name in Manifest file and Application ID in Gradle

What is the difference between package name vs applicationId.

I want to know the differences between them, while both having a different way to use in this code. to get package name u need context and way something like this

context.getPackageName();

and for the sake of applicationId no need of context or activity,

BuildConfig.applicationId

and I've observed on play store link applicationid is now your linked id, instead of package name.

The question is the same as a post in the following link but answers not satisfy me. What is the difference between changing package name vs applicationId

Upvotes: 1

Views: 801

Answers (1)

Deep Shah
Deep Shah

Reputation: 1364

Here is explanation

The Package Name is defined as part of the Manifest and represents the identity of any given app both on an individual device, and on the Google Play store (or any other app store for that matter). Therefore your package name has to be unique.

However it is sometimes useful to be able to produce separate APKs with different identities (e.g. different IDs for debug & release builds so that they can be published as distinct entities in Fabric Beta). To facilitate this we can control the applicationId in our build.gradle and this enables us have distinct package names. We can see this in a simple project.

Source of Answer : https://blog.stylingandroid.com/package-name-vs-application-id/

Another source to refer : https://blog.mindorks.com/android-package-name-vs-application-id-ad95b08815a6

Hope it helps!

Upvotes: 1

Related Questions