What Should Be the Package Name of Android App

What should be the package name of android app?

As stated here: Package names are written in all lower case to avoid conflict with the names of classes or interfaces.

Companies use their reversed Internet domain name to begin their package names—for example, com.example.mypackage for a package named mypackage created by a programmer at example.com.

Name collisions that occur within a single company need to be handled by convention within that company, perhaps by including the region or the project name after the company name (for example, com.example.region.mypackage).

Packages in the Java language itself begin with java. or javax.

In some cases, the internet domain name may not be a valid package name. This can occur if the domain name contains a hyphen or other special character, if the package name begins with a digit or other character that is illegal to use as the beginning of a Java name, or if the package name contains a reserved Java keyword, such as "int". In this event, the suggested convention is to add an underscore. For example:

Sample Image

Android - Package Name convention

Android follows normal java package conventions plus here is an important snippet of text to read (this is important regarding the wide use of xml files while developing on android).

The reason for having it in reverse order is to do with the layout on the storage media. If you consider each period ('.') in the application name as a path separator, all applications from a publisher would sit together in the path hierarchy.
So, for instance, packages from Adobe would be of the form:

com.adobe.reader (Adobe Reader)

com.adobe.photoshop (Adobe Photoshop)

com.adobe.ideas (Adobe Ideas)

[Note that this is just an illustration and these may not be the exact package names.]

These could internally be mapped (respectively) to:

com/adobe/reader

com/adobe/photoshop

com/adobe/ideas

The concept comes from Package Naming Conventions in Java, more about which can be read
here:*

http://en.wikipedia.org/wiki/Java_package#Package_naming_conventions

Source: http://www.quora.com/Why-do-a-majority-of-Android-package-names-begin-with-com

What should be my Android package name?

In general, a package name begins with the top level domain name of the organization and then the organization's domain and then any subdomains, listed in reverse order. The organization can then choose a specific name for its package. Subsequent components of the package name vary according to an organization's own internal naming conventions.

For example, if an organization in Canada called MySoft creates a package to deal with fractions, naming the package ca.mysoft.fractions distinguishes the fractions package from another similar package created by another company.

for instance, packages from Adobe would be of the form:

com.adobe.reader (Adobe Reader)

com.adobe.photoshop (Adobe Photoshop)

com.adobe.ideas (Adobe Ideas)

The concept comes from Package Naming Conventions in Java, more about which can be read here:

wikipedia

quora

Development package name different from the PROD package name

The problem you are facing with billing, is exactly as you thought due to the different package names. Regardless of whether your package names are similar, if they have at least 1 different character, then both the OS and Google treat them as two completely unrelated and different apps.

You should always use a fixed package name regardless the build type or any other requirement. The package name is your app's unique identifier and must be permanently fixed.

To differentiate debug/release builds use instead build variants.

If you need to test billing in debug, first publish a release build as internal test, then you will be able to test your debug builds. Notice it may take a few hours until you are able to start testing once published.

How to name an Android application package for a site that does not begin with .com

According to the comments posted above, it is okay to use a domain other than ".com" in the package name. ".io" and ".org" work as well. However, try to avoid using copyrighted or trademarked names to avoid any legal consequences.

What is the difference between changing package name vs applicationId

The package name is just to organize your code.

The applicationId, on the other hand, is used to identify your app in the Play Store. You will change this only if you plan to generate another app based on same code.

From docs (https://developer.android.com/studio/build/application-id.html):

When you create a new project in Android Studio, the applicationId
exactly matches the Java-style package name you chose during setup.
However, the application ID and package name are independent of each
other beyond this point. You can change your code's package name (your
code namespace) and it will not affect the application ID, and vice
versa (though, again, you should not change your application ID once
you publish your app). However, changing the package name has other
consequences you should be aware of, so see the section about
modifying the package name.

Does the Application name in Package Name has to be unique for google play?

You can release an app named the exact same title string as another app, the package name (in reverse web URL format) is what keeps it unique, for example com.mywebsite.myappname or com.mywebsite.mysuitename.myappname, but I would suggest a creative name for something going on the market!

The package name serves as a unique identifier for the application.

Problem: Once you publish your application, you cannot change the package name. The package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version.

Android app package name

Only the package name in AndroidManifest.xml counts and must not change. The package you put your Java classes in can be anything.



Related Topics



Leave a reply



Submit