The instructions for setting the application ID in Android Studio make it clear that this name has nothing to do with DNS names. It looks a little like a DNS name, but they have no significant relationship.
It is related to the Java or Kotlin namespace used within the app, but it is not synonymous with that; they often are the same but they need not be.
Every Android app has a unique application ID that looks like a Java or Kotlin package name, such as com.example.myapp. This ID uniquely identifies your app on the device and in the Google Play Store.
Although the application ID looks like a traditional Kotlin or Java package name, the naming rules for the application ID are a bit more restrictive:
- It must have at least two segments (one or more dots).
- Each segment must start with a letter.
- All characters must be alphanumeric or an underscore [a-zA-Z0-9_].
It is recommended that you do the following when setting the application ID:
- Keep the application ID the same as the namespace. The distinction between the two properties can be a bit confusing, but if you keep them the same, you have nothing to worry about.
- Don't change the application ID after you publish your app. If you change it, Google Play Store treats the subsequent upload as a new app.
- Explicitly define the application ID. If the application ID is not explicitly defined using the
applicationId
property, it automatically takes on the same value as the namespace. This means that changing the namespace changes the application ID, which is usually not what you want.
For the reasons for bigger-to-smaller ordering, the reverse of DNS' smaller-to-bigger order, see this Stack Overflow question.
I have never personally set up an applicationId
for an Android app, but I have had to use the very similar app identities in iOS. When I did that, I deliberately avoided using the DNS name for the company because that had changed several times in the previous decade. It seemed better to use the long form of the company name, the line of business (which has moved between divisions several times) and an identity for the individual app.
You will find that executive management in large companies don't care about any relationship you may create between DNS names and Android applicationId
values. They have people to take care of such things for them, the application developers. If you complain they're creating problems by re-organising the company, they'll hear that as "I can't do my job properly and I'm fool enough to make that obvious."
flatpak list
merely as a comparator, to demonstrate why I'm surprised, since seeing such an example there would be equally as unusual – though I suppose that in retrospect, it isn't, per your comment. Can you seriously name a package anything? The DNS is mere convention? I've modified the question significantly to make it more comprehensible – I hope it remediates your qualms.