Package Name Problem

manios

Active Member
Licensed User
Longtime User
Hi,

I try to enter a package name like this:

de.2xy.mypackagename

However I get an "Invalid Value" Message. If I exchange the number "2" against a letter it will work.
The domain 2xy.de is a valid domain name (pls note I "obfuscated" the name a bit, but it has three characters and starts with a number)

Is this behavior related to android rules or just a misbehavior of b4a?
 

Kevin

Well-Known Member
Licensed User
Longtime User
It sounds as though it doesn't like numbers in the package name but whether that is a B4A thing or Android thing, I don't know.

Note though, that although including domain information as part of the package name is a preferred thing per the SDK and android website, you do not need to do that. I'd either leave the number out or exchange it for a letter as you already tried. Or just spell out the 2 (two). Doesn't really matter.
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
Found this on developer.android.com (bold emphasis is mine):

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).

Sounds like you can have numbers in it but each section cannot start with a number. I.E. xy2 would be okay but not 2xy. At least that is how I interpreted the above quote.
 
Upvote 0

manios

Active Member
Licensed User
Longtime User
Kevin,

thanks for digging this out for me!

Sounds not very logical to me to suggest to use domainnames and not allowing ALL valid domainnames. Well, I will than use a different domain as package name.
 
Upvote 0
Top