Question: I want to show the location of an address in Google Maps.

How do I get the latitude and longitude of an address using the Google Maps API?

Answer: 
```
public GeoPoint getLocationFromAddress(String strAddress) {

    Geocoder coder = new Geocoder(this);
    List<Address> address;
    GeoPoint p1 = null;

    try {
        address = coder.getFromLocationName(strAddress, 5);
        if (address == null) {
            return null;
        }
        Address location = address.get(0);
        location.getLatitude();
        location.getLongitude();

        p1 = new GeoPoint((double) (location.getLatitude() * 1E6),
                (double) (location.getLongitude() * 1E6));

        return p1;
    } catch (IOException e) {
        e.printStackTrace();
    }
    return null;
}

```

`strAddress` is a string containing the address. The `address` variable holds the converted addresses.
An answer to Kandha problem above :

> 
> It throws the "java.io.IOException service not available" 
>  i already gave those permission and include the library...i can get map view...it throws that IOException at geocoder...
> 
> 
> 

I just added a catch IOException after the try and it solved the problem

```
    catch(IOException ioEx){
        return null;
    }

```