com.organizationName.appName
但是,如果organizationName或appName以数字或下划线开头,则它将变为无效名称,因为android不接受以数字或下划线开头的单词.
例如:
com.1organizationName.appName无效
重命名此包的惯例是什么?
解决方法
In some cases,the internet domain name may not be a valid package
name. This can occur if the domain 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 package name contains a reserved Java keyword,such as “int”.
In this event,the suggested convention is to add an underscore.
所以在你的情况下,它将是com._1organizationname.appname
编辑:刚刚在Android docs发现:
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.
所以显然它不是Java风格.不幸的是,在这种情况下看起来你最好的选择实际上是拼出数字,例如com.oneorganizationname.appname.