For the "Hello World" example in android.com, the package name is
"package com.example.helloandroid;"
这个包裹的命名有什么指导原则/标准吗?(参考资料会更好)
For the "Hello World" example in android.com, the package name is
"package com.example.helloandroid;"
这个包裹的命名有什么指导原则/标准吗?(参考资料会更好)
Android遵循正常的java软件包约定,另外这里还有一段重要的文本可供阅读(这对于在Android上开发时广泛使用xml文件很重要).
The reason for having it in reverse order is to do with the layout on the storage media. If you consider each period ('.') in the application name as a path separator, all applications from a publisher would sit together in the path hierarchy. So, for instance, packages from Adobe would be of the form:个
com.adobe.reader (Adobe Reader)
com.adobe.photoshop (Adobe Photoshop)个
com.adobe.ideas (Adobe Ideas)
[请注意,这只是一个示例,这些可能不是确切的软件包名称.]
这些可以(分别)在内部映射到:
com/adobe/reader
com/adobe/photoshop
com/adobe/ideas
这个概念来自Java中的包命名约定,关于它的更多信息可以阅读
http://en.wikipedia.org/wiki/Java_package#Package_naming_conventions
资料来源:http://www.quora.com/Why-do-a-majority-of-Android-package-names-begin-with-com