javaandroidjavapackager

Android - Is that OK to use two words as package name?


I am building an Android App. Is that OK to use two words as package name?

For example:

com.myapp
com.puzzlegame
com.dingdong

What is the reason behind using three words as a package name?

For example:

com.myapp.android
com.puzzlegame.something
com.dingdong.pingpong

Thanks!!!


Solution

  • You could use the two names as well:

    And although the application ID looks like a traditional Java package name, the naming rules for the application ID are a bit more restrictive:

    It must have at least two segments (one or more dots).
    Each segment must start with a letter.
    All characters must be alphanumeric or an underscore [a-zA-Z0-9_].
    

    Check the official doc for more info:

    For more information please visit this link: Set the application ID