开发者

Android package naming best practices [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

what is the best practice for naming a new android project 开发者_运维问答?


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜