-2

Ok so I know the convention is to put com.domainname.applicationname or something along those lines. What if you don't have a website?

user3843164
  • 369
  • 1
  • 4
  • 14

2 Answers2

1

The purpose of the convention is to reduce the chance of name collisions. The idea is that if you own the "custombuggywhips.com" web site, then you are likely going to be the only developer using the package name com.custombuggywhips. It also reduces the chance of copyright or trademark problems. Android distinguishes between applications based solely on the application package declared in the manifest, so reducing the chance of collisions is very important.

If you don't own a web site, you can still use the convention for a web site that you might someday own and that would likely not be owned by anyone else. Alternatively, you can break with the convention and use a totally made up package name.

But the best thing would be to reserve a domain name for your development work and go with that. You don't actually need a web site, just a name that you can call your own.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
  • +1 for the last sentence. – jdphenix Aug 31 '14 at 05:48
  • Ok thanks! So if I wanted to use a name that I would want to name my company if I had one one day, I could just use: "mycompanyname.games.myapplicationname"? – user3843164 Aug 31 '14 at 05:53
  • @user3843164 - I'd go with "com.mycompanyname.games.myapplicationname" to stick with the usual conventions. Just make sure your dream company name isn't "Ford" or something like that. :) (However, I'd still suggest actually reserving a name. The cost is pretty minor and it's added insurance that someone else won't claim it.) – Ted Hopp Aug 31 '14 at 05:55
  • why does it always start with "com". Just curious. – Psypher Aug 31 '14 at 06:29
  • @Ranjith : It doesn't *always* start with "com". I'm in the UK and I own two domains - my packages start with either "uk.co" or "uk.org" depending on my apps. BAsically it's just a convention using a reverse domain name. – Squonk Aug 31 '14 at 07:02
  • @TedHopp : **"you can still use the convention for a web site that you might someday own and that would likely not be owned by anyone else"** : Risky - it's difficult to pick a domain name which somebody else is never going to want in the future. – Squonk Aug 31 '14 at 07:22
  • @Squonk - Agreed. That's why I added the recommendation to just go ahead and reserve a name. – Ted Hopp Aug 31 '14 at 07:40
0

You don't require valid website to decide on package name. You can define any packagename which is unique and relevant to your app.

For example if your company name is "test" then you can have package name as com.example.test

srs
  • 647
  • 3
  • 11
  • -1, If your distributing your programs to the wider world, having a package named `com.android.` would be a bad idea... why not com.emailprovider.emailusername or the like? – jdphenix Aug 31 '14 at 05:46
  • Not sure, why its Down vote? My answer was just to say that having Website is not mandatory.. You just need to define any package name. – srs Aug 31 '14 at 05:55
  • 1
    You're suggesting naming a package under `com.android`. – jdphenix Aug 31 '14 at 05:57
  • My intention was to explain that you don't need to have the website. Also no-one will stop you for making app starting with com.android ........Anyways.. edited it. – srs Aug 31 '14 at 06:05
  • 1
    Right, it's much better and I removed my downvote because it's not dangerously wrong. On "no-one will stop you" - Yes, I could name my packages `com.google.foo` or `myprogram.stuff.now`, but it's not what _every other Java programmer_ would expect – jdphenix Aug 31 '14 at 06:06
  • @jdphenix - Not only is it not what other programmers would expect, but I suspect that you would be inviting legal action as the name owners sought to protect their IP rights. (I sure wouldn't want someone else using my domain name in their package, and I would do what I could to stop it if I found out it was happening.) – Ted Hopp Aug 31 '14 at 07:44