Do not use numbers or underscores as first characters in Android/Java package names

Well, I’ve been trying different things out at work the last week in order to make some small tests and evaluating different design ideas – I can’t reveal what it’s all about yet, except I could mention some buzz words that doesn’t really say anything (scalability, cross-X, open source, market killer, etc. etc. etc. some of these might be true, some might be wishes and some might just be pure imagination).

Anyway as part of this I have been writing a number of small Android applications – and guess what, I learned the hard way that you can’t use _ (Underscores) or numbers as the first character  like systems.mikek.oneforall is ok, but systems.mikek.1forall isn’t – which might make sense, as numbers are not allowed as the first character in identifiers in many languages (even they are fine for URL’s) – but I was a bit more surprised that prefixing the number with _ wasn’t allowed either – so no systems.mikek._1forall either…  lesson learned 🙂


btw. I don’t know if this is just for Android, or generic for Java (actually I only tried it in an app made in the Qt5 framework for Android).

Leave a Reply

Your email address will not be published. Required fields are marked *

nineteen + = twenty one