We usually have this naming convention - com.something.something in Android.
Is it valid if we do not use the com. part and just keep it like something.something (provided that something.something is unique)
https://stackoverflow.com/a/4620116/6441416
I don't think it would be valid but anyway.
Look through his answer. Hope this helps.
Usually Android follows the naming convention as Java, I think it doesn't make any difference if it is a unique application id..
As per Android Developers
If you have a company domain www.example.com
Than you should use:
com.example.region.projectname
If you own a domain name like example.co.uk than it should be:
uk.co.example.region.projectname
But though many application doesn't have any prefix of domain and also they are running on Play Store for example
The proper way to naming an apk is starting with com.somthing.But not mandatory for google play store.This format comes to make an app id is unique.So you can give your app id anything you want to.
Related
The naming convention is usually company.domain.inreverse.appname
Is there a significance of using the actual company domain
Asking because I by mistake named the package com.companyName.app.appName instead of in.co.companyName.app.appName (where the company's actual internet domain is companyName.co.in)
So would it in any way affect my app, and/or its relation to the website?
No.. it won't. The idea is to give Global uniqueness.
check this page: https://en.wikipedia.org/wiki/Java_package#Package_naming_conventions
The Java Language Specification establishes package naming conventions to avoid the possibility of two published packages having the same name.
But keep in mind this: http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Package names are written in all lower case to avoid conflict with the names of classes or interfaces.
I'm thinking of taking the package name com.mangoapps.appname, but my question is, can someone else also use the prefix "com.mangoapps"?
Since I want to create a series of apps, I want a unique prefix "com.mangoapps".
And another question, how do I know if someone else is already using this package name as prefix?
Is there need of any relation between package name and developer's name?
There is no way to guarantee uniqueness. Anyone can do the same as you, that is just type in the name as packagename.
Things you can do to insure people wont do that, is to take (the reverse) of a domain you own. So if mangoapps.com is yours, there will probably be no one taking that packagename. And if you don't own the domain, you probably don't want to pick the name, as the owner might use it as default.
Because of this, there is also no way to know if someone uses that packagename. There might be a theoretical way to, for instance, check it for one place (e.g. some store, some collection of programs, etc), but I know of no such method for the play store.
There is no need for a relation between your name and the package name. The relation, if any, is with the name and a domain name, although it is not mandatory.
The package names should be based on a domain name that you control or have permission to use - that way ideally you have final say over which packages exist. What is your affiliation with mangoapps.com ?
note that in the real world none of this is enforced except by etiquette.
1) Yes, others can use the same prefix. Generally speaking, the prefix should be the reverse of your domain but it doesn't have to be, it can be anything. The prefix isn't visible to others so you could for example use com.SameerThigale if you don't have any other suitable domain to use.
2) They may already be doing so and there is no way to tell. However it doesn't really matter. All that needs to be unique (if you want to upload to the Play Store) is your prefix plus appname, i.e the complete package name. By choosing a prefix that relates in some way to you, you effectively eliminate the likelihood of conflicting with others.
3) There need be no relation between the package name and yourself. The package name is just a unique identifier for your application.
Sealing Packages within a JAR says
Packages within JAR files can be optionally sealed, which means that all classes defined in that package must be archived in the same JAR file.
So if your JAR is sealed and appears early on the CLASSPATH, then you can be sure that no other jars will be able to include classes in your package that have privileged access to package-private members.
Yes someone else can also use the prefix though the people won't do it in general as the name of their company is used after com prefix.
Its a part of url so you can always append to the url itself and search on google play
As I stated in the first point the developer/organization name is part of the package name itself.
i.e. com.mangoapps.appname
com -> company
mangoapps -> name of the company
appname -> name of the specific application that user will search on play store
Hope the question is clear enough. I don’t find something appropriate here or somewhere in the web which explains me why is it not possible. Maybe some of you can help me out?
It’s a general question with no problem in background (however you can always change the name of the package to avoid this) but I want to understand the idea behind this.
[Update]
Maybe I got a wrong expression about the package name? I think a package name is used to create logical units together. So, e.g. I check a slider and a checkbox alone I create a package name like de.test to put these projects to the same package name. And if I create some customer project I use a package name like de.company for all my projects. But if it’s the package name only for create a unique modifier this though is wrong…
The simple explanation is that the package name represents the unique identifier for the application. Its given in the google documentation for mainfest file
Here is the link and a line from that page. This link will also give you more idea.
It names the Java package for the application. The package name serves
as a unique identifier for the application.
Almost all android apps have links to 'developer's website'. Typically websites are used in assigning name spaces.
How can I assign unique package namespace if I don't have any website?
Or to put it other words, is website a parameter in assigning the namespace
If yes, can you please guide me how to get own site?
Dharma
The namespace is just that, a namespace. There is no need to create or own your own domain. You just need to be sure that your namespace is reasonable unique.
You dont need any website at all, package system is as the following:
If your package name is com.dharma.app then eclipse will generate a folder system like "src\com\dharma\app\". So, in the src(sources) folder, the outer folder will be com, 1 level deeper dharma, 1 level deeper app. Hope you understand it this way.
It's a good practice to name your packages following the java package naming convention. Following this article:
http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
This is recommended but not mandatory. i.e. you can just use an appropriate namespace without actually owning the domain.
You can use some other method of uniquely identifying your apps if you do not have a web domain name to use. Domain name is the recommmended way, but for example an email address or some other package name can be used as well depending on how important it is for you to distinguish your app as one made by a company.
For the "Hello World" example in android.com, the package name is
"package com.example.helloandroid;"
Is there any guideline/standard to name this package? (references would be nice)
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
The package name is used for unique identification for your application.
Android uses the package name to determine if the application has been installed or not.
The general naming is:
com.companyname.applicationname
eg:
com.android.Camera
http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
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).
If you have a company domain www.example.com
Then you should use:
com.example.region.projectname
If you own a domain name like example.co.uk than it should be:
uk.co.example.region.projectname
If you do not own a domain, you should then use your email address:
for name#example.com it should be:
com.example.name.region.projectname
com = commercial application (just like .com, most people register their app as a com app)
First level = always the publishing entity's' name
Second level (optional) = sub-division, group, or project name
Final level = product name
For example the android launcher (home screen) is
com.google.android.launcher
Generally the first 2 package "words" are your web address in reverse. (You'd have 3 here as convention, if you had a subdomain.)
So something stackoverflow produces would likely be in package com.stackoverflow.whatever.customname
something asp.net produces might be called
net.asp.whatever.customname.omg.srsly
something from mysubdomain.toplevel.com would be
com.toplevel.mysubdomain.whatever
Beyond that simple convention, the sky's the limit. This is an old linux convention for something that I cannot recall exactly...
From the Kotlin Android style guide:
Package names are all lowercase, with consecutive words simply
concatenated together (no underscores).
https://developer.android.com/kotlin/style-guide#package_names
But if your Android App is only for personal purpose or created by you alone, you can use:
me.app_name.app