• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

API that lists all countries in the world

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic