Get th lat and lon using address

Posted by sairam333 on Stack Overflow See other posts from Stack Overflow or by sairam333
Published on 2010-05-11T09:52:10Z Indexed on 2010/05/11 9:54 UTC
Read the original article Hit count: 321

Filed under:

Hi I use below code for getting the lattitude and longitude Using the given address

try {

                  List<Address> foundAdresses = gc.getFromLocationName(addressInput, 5); //Search addresses

                 for (int j = 0; j < foundAdresses.size(); ++j) {
                      //Save results as Longitude and Latitude
                      //@todo: if more than one result, then show a selected-list
                      Address x = foundAdresses.get(j);
                        lat = x.getLatitude();
                        lon = x.getLongitude();


                    } 
                }
            catch(Exception e)
            {

}

But the above code does not return any values into lat,lon(double variables), and i sue the uses-permissions in android manifest file also But the lat,lon variables does not getting any values.Please give me some suggestions.Thanks in advance.

© Stack Overflow or respective owner

Related posts about android