• Post Reply Bookmark Topic Watch Topic
  • New Topic

API that lists all countries in the world

 
Namitha karupaiya
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any API in Java that lists all the countries in the world? If so, this is very useful in a top down menu to select a desired country. Thank you very much.
 
Fletcher Estes
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you write one and make it available to the on-line community? All you need to do is find a list of all countries in text form somewhere on the web, and write a simple class to return this list in various forms (maybe String array, ArrayList, HashSet). I'm sure it would prove useful to people.

Now get to work
 
Namitha karupaiya
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Java support internationalization, as thought there may be a built in facility like this. If there is a built in facility like this it will be pleasing.
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Namitha karupaiya:
As Java support internationalization, as thought there may be a built in facility like this. If there is a built in facility like this it will be pleasing.


Mmmm...how do you expect Java to provide a built in facility like this? From where will Java get the list of countries in the world? Do you expect them to hard-code it somewhere (as constants may be). What if a new country is created? What if an existing country disappears (say it got merged with another country)? How can the list be updated in those cases.
And providing just a list of Country names will be very primitive. If at all it has to add some value, it should include lot of other information (like capital name, currency etc), which might change.

Even you can't create a API to do this. You can expose these information us a web service for others to use, may be
[ October 07, 2004: Message edited by: Mani Ram ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!