Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Package Name - Using Dashes

I was wondering if you could use dashes in a package name for an Android application?

like image 243
Americo Avatar asked Dec 06 '12 22:12

Americo


People also ask

Can package names have hyphens?

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.

Is hyphen allowed in Java package name?

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.

How does Android define package name?

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.

Why do Android package names start with com?

Companies use their reversed Internet domain name to begin their package names—for example, com.

Can you use dashes in a package name for Android applications?

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.

How do I find the package name of an Android app?

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.

Why do I need to name my Android app package?

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.

How do I list all packages on Android?

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.


1 Answers

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.

like image 57
Sam Avatar answered Sep 30 '22 14:09

Sam