12

If I own a domain name like e.g Dan-Carlos.com

Does the andoid package name allow use like com.dan-carlos.com?

I have not tried using it but I am curious if anyone tried domain name with hyphen '-' in it.

OneCricketeer
  • 151,199
  • 17
  • 111
  • 216
anwarma
  • 1,905
  • 5
  • 20
  • 21

4 Answers4

15

refer to my working years and some web pages like this you should replace "-" dashes with "_" underline.

if web site is : dan-carlos.com

package name is : com.dan_carlos

2

According to the 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.

So, sadly you can't use anything else except for English letters, digits, the character "." and the character "_" .

android developer
  • 112,189
  • 137
  • 688
  • 1,196
0

No unfortunately the hyphen '-' is not acceptable in a package name.

You can simply test this out by right clicking a project and going to properties -> Android -> rename application package and try out what is accepted

iko_wp
  • 729
  • 6
  • 9
0

Allowed characters in package name are A to Z (small and caps case), period (.) and underscore ( _ ). So you can have package name com.dan.carlos or com.dan_carlos

seema
  • 991
  • 1
  • 13
  • 27