Can someone else use the same package name prefix?

2019-04-29 08:21发布

  1. 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".

  2. And another question, how do I know if someone else is already using this package name as prefix?

  3. Is there need of any relation between package name and developer's name?

5条回答
狗以群分
2楼-- · 2019-04-29 08:51

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.

查看更多
一夜七次
3楼-- · 2019-04-29 08:51
  1. 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.

  2. Its a part of url so you can always append to the url itself and search on google play

  3. 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
查看更多
欢心
4楼-- · 2019-04-29 09:01

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.

查看更多
男人必须洒脱
5楼-- · 2019-04-29 09:06

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.

查看更多
仙女界的扛把子
6楼-- · 2019-04-29 09:07

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.

查看更多
登录 后发表回答