Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Android require the package name to have at least two identifiers?

Tags:

android

When creating a new Android application, Eclipse complains Package name must have at least two identifiers and Netbeans complains Package name must have at least two parts (Android Bug).

I understand how to work around this problem. My question is: where is this limitation coming from? I didn't find a mention of it in the Android documentation or the issue tracker.

like image 357
Gili Avatar asked Feb 11 '12 21:02

Gili


People also ask

What does package name mean in Android?

The package name of an Android app uniquely identifies your app on the device, in Google Play Store, and in supported third-party Android stores.

Is package name important in Android Studio?

It shouldn't matter. In case you still wish to change, you have to unpublish your app and publish it as a new app. This is because Google identifies your app through you bundle ID, or package name as it is called. So you cannot repeat 2 package names.

What is the difference between application ID and package name?

The package name is just to organize your code. The applicationId, on the other hand, is used to identify your app in the Play Store. You will change this only if you plan to generate another app based on same code.


2 Answers

My question is: where is this limitation coming from?

Particularly since the package must be unique on the device and unique on the Android Market, the strong recommendation is for you to use standard Java reverse-domain-name conventions for your package. Quoting the documentation:

To avoid conflicts with other developers, you should use Internet domain ownership as the basis for your package names (in reverse). For example, applications published by Google start with com.google. You should also never use the com.example namespace when publishing your applications.

A domain name must have at least two segments; hence, the restriction requiring two segments.

like image 172
CommonsWare Avatar answered Oct 15 '22 17:10

CommonsWare


So you need to put at least two words separated by a dot. For example: daniel.bug

like image 25
Daniel Azamar Avatar answered Oct 15 '22 19:10

Daniel Azamar