Print

Any Android application has a unique package name distinguishing the app on devices and app markets such as Bazaar. In other words, the package name is the identification tool for each app and is frequently called Application ID.

Caution: Once you publish your app in Bazaar under a specific package name, you won’t be able to change the name later on. If you change the package name, Bazaar will recognize the app as a new one, and you won’t be able to update the original application.

Rules for naming packages

The rules for naming packages in Android are the same as those in Java programming.

You can use the following formula to name your package:

topleveldomain.companyname.applicationname

The first two segments of the application package name are your website address written in reverse order. For example, if your website address is www.example.ir and you intend to build a flashlight app, then:

topdomainname: ir

companyname: example

applicationname: flashlight

So, you would better name your application package as following:

ir.example.flashlight

Allowed characters


Naming a package, you are allowed to use the following characters:

  • Capital and small English letters (‘A’ to ‘Z’ and ‘a’ to ‘z’)
  • English numbers (‘0’ to ‘9’)
  • Underscore (‘_’)

Note: It is recommended not to use capital letters in package names to avoid similarity to class names.

Special cases

  • If your website address includes special characters such as dash (-), which you cannot use in the package name, we recommend using underscore (‘_’) instead. For example, if the address is www.android-example.ir, we suggest using ir.android_example.flashlight as a package name.
  • Your website address may contain some Java-reserved words, which you cannot use as part of a package name. In this case, we recommend using underscore (‘_’) at one end of the word. For example, if your website address is www.example.int, since “int” is a Java-reserved word, you would preferably use int_.example.flashlight as the package name.

Note: Also, pay attention that the first letter of each segment of a package name (i.e., the letter that follows a dot) should be an English letter. Here you would not be able to use numbers or underscore. For example, ir.example.1flashlight or ir._example.flashlight cannot be accepted as package names.

Was this content helpful?
Write your comment here...

If you have any comment on this content or any idea to make it better, use this form to send us your comment.

Publish Date: ۱۴۰۰-۰۳-۳۰ ۰۸:۰۰

Latest Update: ۱۴۰۰-۰۴-۱۰ ۱۴:۰۰