3

I want Institute, Company, Business name along with it's address when I tap on icon which is on Google Map.

Example :- On Google Map Application, when be will tap on icon then it will show complete detail and address for that icon.

Find three images. There when I tap on "HealthCare Global Enterprise Ltd." icon then it gives complete address with Hospital name on top of the screen.

I am using Geocoder to get address for particular latitude-longitude. I am getting street, country, pincode etc but not able to get institute, company, business name.

Here Hospital Name : HealthCare Global Enterprise Ltd.

Code :-

private String getCompleteAddressString(double LATITUDE, double LONGITUDE) {
    String strAdd = "";
    Geocoder geocoder = new Geocoder(this, Locale.getDefault());
    StringBuilder strReturnedAddress = null;
    try {
        List<Address> addresses = geocoder.getFromLocation(LATITUDE, LONGITUDE, 1);
        if (addresses != null) {
            System.out.println("Address Size ->>: " + addresses.size());
            System.out.println("Address 0th Position ->>: " + addresses.get(0));
            Address returnedAddress = addresses.get(0);
            strReturnedAddress = new StringBuilder("");

            for (int i = 0; i < returnedAddress.getMaxAddressLineIndex(); i++) {
                strReturnedAddress.append(returnedAddress.getAddressLine(i)).append("\n");

                System.out.println("*****************************");
                System.out.println("Admin Area: ->> " + returnedAddress.getAdminArea());
                System.out.println("Country Code: ->> " + returnedAddress.getCountryCode());
                System.out.println("Country Name: ->> " + returnedAddress.getCountryName());
                System.out.println("Feature Name: ->> " + returnedAddress.getFeatureName());
                System.out.println("Admin Area: ->> " + returnedAddress.getLatitude());
                System.out.println("Latitude: ->> " + returnedAddress.getLocality());
                System.out.println("Longitude: ->> " + returnedAddress.getLongitude());
                System.out.println("Max Address Line Index: ->> " + returnedAddress.getMaxAddressLineIndex());
                System.out.println("Phone: ->> " + returnedAddress.getPhone());
                System.out.println("PostalCode: ->> " + returnedAddress.getPostalCode());
                System.out.println("Premises: ->> " + returnedAddress.getPremises());
                System.out.println("SubAdminArea: ->> " + returnedAddress.getSubAdminArea());
                System.out.println("SubLocality: ->> " + returnedAddress.getSubLocality());
                System.out.println("SubThoroughfare: ->> " + returnedAddress.getSubThoroughfare());
                System.out.println("Thoroughfare: ->> " + returnedAddress.getThoroughfare());
                System.out.println("Url: ->> " + returnedAddress.getUrl());
                System.out.println("*****************************");
            }
            strAdd = strReturnedAddress.toString();
            Log.w("My Current loction address", "" + strReturnedAddress.toString());
        } else {
            Log.w("My Current loction address", "No Address returned!");
        }
    } catch (Exception e) {
         strReturnedAddress.append("Address Not Avilable");
         strAdd = strReturnedAddress.toString();
    }
    return strAdd;
}

enter image description here enter image description here enter image description here

Vinit ...
  • 1,409
  • 10
  • 37
  • 66
  • is this want u would want to know ?http://stackoverflow.com/questions/2273207/using-google-maps-api-to-get-address-of-business – Dhinakaran Thennarasu Sep 30 '14 at 09:54
  • NO.. my question is crystal clear... when you open google map app then you will see lot's of icon there. like hospital, school, institute, shop etc. When you tap on that icon then on the top of the map you will see name and complete address for that icon. – Vinit ... Sep 30 '14 at 11:54
  • http://wptrafficanalyzer.in/blog/showing-nearby-places-and-place-details-using-google-places-api-and-google-maps-android-api-v2/ May be this ? with the places API. you will need a Places API Key – Dhinakaran Thennarasu Sep 30 '14 at 12:34

1 Answers1

0

Please take a look at Google API picker which can be helpful in identifying which Google API to use to get the kind of data you are looking for. Based on your question, it looks like you want a location's business or company name, and additional details. It is available via Google Place API, below is its summary.

"Get the name, address, opening hours, and other details of a place, including customer ratings and reviews."

It is REST type of API , you can provide the coordinates of the location, and get back the details as JSON. Please see this SO question and answer for a sample code snippet.

Community
  • 1
  • 1
ashoke
  • 6,441
  • 2
  • 26
  • 25