GeoDataApi | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
public interface

# GeoDataApi

com.google.android.gms.location.places.GeoDataApi

## Class Overview

Main entry point for the Google Geo Data API.

The Geo Data API provides access to Google's database of local place and business information. A place, generally, is defined as a particular physical space that has a name. The GeoDataApi provides access to getting places by ID, autocompleting a user's search query by name or address, and adding places to Google's Places database. Most API methods may involve a round-trip to a Google server.

Some methods of the GeoDataApi API are subject to a quota limit, as mentioned in the description of the methods concerned.

See `PlacesStatusCodes` for detailed information about the error codes.

## Summary

Public Methods
abstract PendingResult<PlaceBuffer> | addPlace(GoogleApiClient client, AddPlaceRequest addPlaceRequest) Add a place to Google's Places database.
abstract PendingResult<AutocompletePredictionBuffer> | getAutocompletePredictions(GoogleApiClient client, String query, LatLngBounds bounds, AutocompleteFilter filter) Get autocomplete predictions for a query, based on the name or address of a place.
abstract PendingResult<PlaceBuffer> | getPlaceById(GoogleApiClient client, String... placeIds) Returns the places for the given `placeId`s.

## Public Methods

#### public abstract PendingResult<PlaceBuffer> addPlace (GoogleApiClient client, AddPlaceRequest addPlaceRequest)

Add a place to Google's Places database.

By adding a place, you can supplement the data in the Google's database with data from your application. This allows you to:

1. Instantly update the data in Google's database for your users.
2. Submit new places to a moderation queue for addition to the Google places database.
3. Differentiate your application from other apps with similar functionality.
4. Create applications that are targeted to a specific user base or geographic location.

##### Returns

- a buffer containing the added place.

#### public abstract PendingResult<AutocompletePredictionBuffer> getAutocompletePredictions (GoogleApiClient client, String query, LatLngBounds bounds, AutocompleteFilter filter)

Get autocomplete predictions for a query, based on the name or address of a place.

Access to this method is subject to quota restrictions.

##### Parameters

query | for which the autocomplete predictions are to be fetched.
filter | criteria for customizing the autocomplete predictions.

##### Returns

- a PendingResult containing the list of predictions for the query which match the filter criteria, or an empty list if none match.

#### public abstract PendingResult<PlaceBuffer> getPlaceById (GoogleApiClient client, String... placeIds)

Returns the places for the given `placeId`s.

Note that the ID for given place, once returned by some Places API call, should always be valid for passing to this method. However, place IDs can change over time, so the returned Places may have a different IDs than the ones used for looking it up. This method might return fewer places than requested if some of the places could not be resolved.

##### Parameters

placeIds | the IDs to look up. At least one ID should be provided.

##### Returns

- a buffer containing the requested places.