what is the best practice for naming a new android project ?
-
1`com.CompanyName.ProjectName.ComponentName` ? – mauris Mar 26 '11 at 23:47
-
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html – serv-inc Jan 27 '18 at 12:23
-
hobbyists might use https://stackoverflow.com/questions/292169/what-package-naming-convention-do-you-use-for-personal-hobby-projects-in-java – serv-inc Jan 27 '18 at 12:28
2 Answers
Do you have a name for your company?
eg com.mycompany.function
look at what other companies/orgs do:
Eclipse swt plugin project: org.eclipse.swt
JUNit: org.junit
Apache: org.apache.commons

- 2,551
- 24
- 27
-
3
-
4com is for company, org is for organization. It depends who the project is for. Is the company/project website a .com or a .org domain is usually a good rule of thumb. – katsharp Mar 26 '11 at 23:53
-
6The reason that package names usually start with reverse domain names (e.g., com.android) is that it ensures uniqueness. If everyone follows the convention, then package names between multiple applications will never conflict. – Zach Rattner Mar 26 '11 at 23:59
-
Of course, when choosing a package name, understand how the Android Market will use it, and what the Android Dev Guide has to say about it.
http://developer.android.com/guide/publishing/publishing.html
http://developer.android.com/guide/topics/manifest/manifest-element.html
Package
A full Java-language-style package name for the application. The name should be unique. The name may contain uppercase or lowercase letters ('A' through 'Z'), numbers, and underscores ('_'). However, individual package name parts may only start with letters. 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.
The package name serves as a unique identifier for the application. It's also the default name for the application process (see the
<application>
element's process process attribute) and the default task affinity of an activity (see the<activity>
element's taskAffinity attribute).Caution: Once you publish your application, you cannot change the package name. The package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version.

- 8,545
- 2
- 35
- 55

- 4,093
- 4
- 26
- 24
-
4Per what you wrote, couldn't I just create a package name com.somewebsite even though I do not own the domain name somewebsite.com? Then the person who does own that website, if they ever made an Android app, would be fresh out of luck no? – Micro Aug 19 '15 at 19:20