title: How do I use Google Maps API in a Java code to fetch coordinates of specified location?
body: <p>In a BI project I'm currently working on, we are in need of geo-coordinates for a list of locations. With the address location (such as <code>"New York, US"</code>) as input, the output should be the coordinates as a latitude-longitude pair (like <code>{40.71435, -74.00597}</code>). The behaviour is similar to what is seen on <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" rel="nofollow noreferrer">this</a> page.</p>
  
  <p>A <a href="https://stackoverflow.com/q/6293490/979621">similar question earlier on SO</a> points to using the Google Maps API in JavaScript to achieve this, but I'm looking for a Java solution -- some function of the form <code>getCoordinates(location)</code>, because this is a small requirement in a larger Java program already in existence.</p>
  
  <p>Any pointers on how I may use the Google Maps API (or any other maps API) in Java to achieve this would be of great help!</p>