为什么Android的要求至少有两个标识符包的名称? [英] Why does Android require the package name to have at least two identifiers?

查看:126
本文介绍了为什么Android的要求至少有两个标识符包的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建一个新的Andr​​oid应用程序,的 Eclipse的抱怨包名称必须至少有两个标识符和<一个href=\"http://$c$c.google.com/p/nbandroid/source/browse/project/src/org/netbeans/modules/android/project/ui/wizards/Bundle.properties?spec=svn46a5b01adf2736a4315e43c87b5b2eb75af2f58e&r=46a5b01adf2736a4315e43c87b5b2eb75af2f58e\"相对=nofollow> Netbeans的抱怨包名称必须至少有两个部分(Android的错误)

我知道如何解决这个问题。我的问题是:这哪里是限制来自哪里?我没有找到它的Andr​​oid文档中提及或问题跟踪


解决方案

  

我的问题是:这哪里是限制来自哪里


特别是因为包必须是设备和独特的在Android Market上的独特,强烈的建议是您使用标准的Java反向域名约定你的包。引用文档


  

要避免与其他开发商发生冲突,你应该使用互联网域名所有权为您的包名的基础上(反向)。例如,由谷歌发布的应用程序开始com.google。你也应该永远不会发布您的应用程序时使用的com。示例命名空间。


一个域名必须至少有两个部分;因此,限制需要两个片段。

When creating a new Android application, Eclipse complains Package name must have at least two identifiers and Netbeans complains Package name must have at least two parts (Android Bug).

I understand how to work around this problem. My question is: where is this limitation coming from? I didn't find a mention of it in the Android documentation or the issue tracker.

解决方案

My question is: where is this limitation coming from?

Particularly since the package must be unique on the device and unique on the Android Market, the strong recommendation is for you to use standard Java reverse-domain-name conventions for your package. Quoting the documentation:

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.

A domain name must have at least two segments; hence, the restriction requiring two segments.

这篇关于为什么Android的要求至少有两个标识符包的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆