What should be the name of the Android application package?

I want to know what should be the name of an Android app package? So, we usually used com.appname OR com.organizationName.appName, but when we send our application to the market, sometimes it shows errors related to the package name, which: - change the name of the package. It should not start with com, etc.

I want to know why this happened? And what should be the correct package name for an Android app?

If anyone knows the reason or the answer to this question, please let me know.

Thanks in advance.

+27
android package
Nov 10 2018-11-11T00:
source share
5 answers

As stated here: package names are written in all lowercase strings to avoid conflicts with class or interface names.

Companies use their reverse Internet domain name to start the names of their packages - for example, com.example.mypackage for a package named mypackage created by a programmer at example.com .

Name conflicts that occur within one company should be processed by agreement within that company, possibly by including a region or project name after the company name (for example, com.example.region.mypackage).

Java packages start with java. or javax.

In some cases, the Internet domain name may not be a valid package name. This can happen if the domain name contains a hyphen or other special character, if the package name starts with a digit or another character that is illegal to use as the beginning of a Java name or if the package name contains a reserved Java keyword such as "int". In this case, the proposed convention is to add underlining. For example:

enter image description here

+40
Nov 10 '11 at 5:08
source share

Android follows the same naming conventions as Java,

Naming conventions

Package names are written in all lower case to avoid conflicts with class or interface names.

Companies use their reverse Internet domain name to start the names of their packages, for example com.example.mypackage for a package called mypackage created by the programmer at example.com.

Name conflicts that occur within one company should be processed by agreement within that company, possibly by including a region or project name after the company name (for example, com.example.region.mypackage).

Java packages start with java. or javax.

In some cases, the Internet domain name may not be a valid package name. This can happen if the domain name contains a hyphen or other special character, if the package name starts with a digit or another character that is illegal to use as the beginning of a Java name or if the package name contains a reserved Java keyword such as "int". In this case, the proposed convention is to add underlining. For example:

Legalization of package names:

  Domain Name Package Name Prefix hyphenated-name.example.org org.example.hyphenated_name example.int int_.example 123name.example.com com.example._123name 
+9
Nov 10 '11 at 5:08
source share

As you pointed out, package names are usually in the form of "com.organizationName.appName" - all lowercase and without spaces. This is similar to the package name you entered when you downloaded the application, different from the one announced in AndroidManifest.

+2
Nov 10 '11 at 4:59
source share

Currently, a package name starting with "com.example" is not allowed to be downloaded to the store application. Otherwise, all other package names starting with "com" are valid.

+1
Mar 25 '13 at 5:26
source share

package name with 0 can cause a problem for sharedPreference.

(OK) con = createPackageContext("com.example.android.sf1", 0);

(Problem, but not error)

 con = createPackageContext("com.example.android.sf01", 0); 
0
Feb 22 '15 at 15:46
source share



All Articles