I was wondering if you could use dashes in a package name for an Android application?
You are right, the simple answer is: You are NOT allowed to use the hypen in package names. If you have a unique package name build from a domainname containing a hyphen you have to translate it to the underscore.
Hyphens in Java Package Name While using hyphens in the names of repository items is a recommended practice in AEM development, hyphens are illegal within Java package names.
You can find an app's package name in the URL of your app's Google Play Store listing. For example, the URL of an app page is play.google.com/store/apps/details? id=com. example.
Companies use their reversed Internet domain name to begin their package names—for example, com.
I was wondering if you could use dashes in a package name for an Android application? No, you cannot use a dash in your package name. This is a great question to test for yourself. If you change the package name in your Manifest or class (I assume the wizard too) it will clearly create compile time errors.
The package name of an Android app uniquely identifies your app on the device, in Google Play Store, and in supported third-party Android stores. You can find an app's package name in the URL of your app’s Google Play Store listing. For example, the URL of an app page is play.google.com/store/apps/details?id=com.example.app123.
You’ll need the name if you’re trying to uninstall an app using ADB, for instance. An Android Package Kit , or APK, is named according to the Java naming convention since most of the OS uses the said programming language. These app package names are always written in lower case letters to avoid name conflicts with java classes.
Android package management is done by the pm command on the ADB shell. To list all the installed packages on an Android device, use the following syntax. To list only the system packages, use the “-s” option. To list only 3rd party (or non-system) packages, use the “-3” option.
No, you cannot use a dash in your package name.
This is a great question to test for yourself. If you change the package name in your Manifest or class (I assume the wizard too) it will clearly create compile time errors.
The link that @vasart posted describes how to use an underscore in place of a dash, if necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With