[ACCEPTED]-What is the rule of the name of the packages that start with number?-naming-conventions

Accepted answer
Score: 22

In the official "Naming a Package" java documentation, it 14 has the following statement:

In some cases, the 13 internet domain name may not be a valid 12 package name. This can occur if the domain 11 name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name, or if the 10 package name contains a reserved Java keyword, such as "int". In this event, the suggested convention is to add an underscore.

So in 9 your case, it would be com._1organizationname.appname

EDIT: Just found 8 this in the Android docs:

A full Java-language-style 7 package name for the application. The name should 6 be unique. The name may contain uppercase 5 or lowercase letters ('A' through 'Z'), numbers, and 4 underscores ('_'). However, individual package name parts may only start with letters.

So apparently it's not quite 3 Java-style. Unfortunately, it looks like 2 your best bet in this case would in fact 1 be to spell out the number, e.g. com.oneorganizationname.appname.

Score: 2

The naming convention is merely to help 7 you create a unique package name for the 6 Play market. If you use your company's 5 website address backwards (i.e. com.websitename.appname), then 4 it's unlikely another app in the Play market 3 will have it. You can name the package 2 whatever you want so you can spell the number 1 out to make it easier (com.oneOrganizationName.appName).

Score: 1

See here about the "package" attribute 19 in the manifest:

A full Java-language-style 18 package name for the application. The name should 17 be unique. The name may contain uppercase 16 or lowercase letters ('A' through 'Z'), numbers, and 15 underscores ('_'). However, individual package 14 name parts may only start with letters. To 13 avoid conflicts with other developers, you 12 should use Internet domain ownership as 11 the basis for your package names (in reverse). For 10 example, applications published by Google 9 start with com.google. You should also never 8 use the com.example namespace when publishing 7 your applications.

The package name serves 6 as a unique identifier for the application. It's 5 also the default name for the application 4 process (see the element's process process 3 attribute) and the default task affinity 2 of an activity (see the element's taskAffinity 1 attribute).

Score: 0

you can try co.m_1organizationName.appName or co.m1organizationName.appName this way your package will 2 not be absurd and the address will be more 1 meaningful.

More Related questions