Android SDK Version
  • java.lang.Object
    • com.facebook.places.PlaceManager

public class PlaceManager
extends java.lang.Object
Provides an interface to search and query the Places Graph. Supports querying the end user's' current place, searching nearby places, and fetching place information details.
Nested Class Summary
Modifier and TypeClass and Description
static class PlaceManager.LocationError
Describes an error that occurred while retrieving the current location.
static interface PlaceManager.OnRequestReadyCallback
Callback invoked when a request has been constructed and is ready to be executed.
Method Summary
Modifier and TypeMethod and Description
static GraphRequestnewCurrentPlaceFeedbackRequest(CurrentPlaceFeedbackRequestParams requestParams)
Creates a new current place feedback request.
static voidnewCurrentPlaceRequest(CurrentPlaceRequestParams requestParams, PlaceManager.OnRequestReadyCallback callback)
Creates a new current place request.
static GraphRequestnewPlaceInfoRequest(PlaceInfoRequestParams requestParams)
Creates a new place info request.
static voidnewPlaceSearchRequest(PlaceSearchRequestParams requestParams, PlaceManager.OnRequestReadyCallback callback)
Creates a new place search request centered around the current device location.
static GraphRequestnewPlaceSearchRequestForLocation(PlaceSearchRequestParams requestParams, Location location)
Creates a new place search request centered around the specified location.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail

newPlaceSearchRequest

public static void newPlaceSearchRequest(PlaceSearchRequestParams requestParams,
                                         PlaceManager.OnRequestReadyCallback callback)
Creates a new place search request centered around the current device location. The SDK will retrieve the current device location using android.location.LocationManager
With the Places Graph, you can search for millions of places worldwide and retrieve information like number of checkins, ratings, and addresses all with one request.
The specified PlaceManager.OnRequestReadyCallback will be invoked once the request has been generated and is ready to be executed.
Parameters:
requestParams - the request parameters. See PlaceSearchRequestParams
callback - the PlaceManager.OnRequestReadyCallback invoked when the GraphRequest has been generated and is ready to be executed

newPlaceSearchRequestForLocation

public static GraphRequest newPlaceSearchRequestForLocation(PlaceSearchRequestParams requestParams,
                                                            Location location)
Creates a new place search request centered around the specified location. If the location provided is null, the search will be completed globally. At least a location or a search text must be provided.
With the Places Graph, you can search for millions of places worldwide and retrieve information like number of checkins, ratings, and addresses all with one request.
Returns a new GraphRequest that is configured to perform a place search.
Parameters:
requestParams - the request parameters. See PlaceSearchRequestParams
location - the Location around which to search
Returns:
a GraphRequest that is ready to be executed
Throws:
FacebookException - thrown if neither location nor searchText is specified

newPlaceInfoRequest

public static GraphRequest newPlaceInfoRequest(PlaceInfoRequestParams requestParams)
Creates a new place info request.
The Places Graph exposes a rich set of information about places. If the request is authenticated with a user access token, you can also obtain social information such as the number of friends who have liked and checked into the PlaceFields. The specific friends are also available if they have authenticated the app with the user_tagged_places and user_likes permissions.
Returns a new GraphRequest that is configured to perform a place info request.
Parameters:
requestParams - the request parameters, a PlaceInfoRequestParams.getPlaceId() must be specified.
Returns:
a GraphRequest that is ready to be executed
Throws:

newCurrentPlaceRequest

public static void newCurrentPlaceRequest(CurrentPlaceRequestParams requestParams,
                                          PlaceManager.OnRequestReadyCallback callback)
Creates a new current place request.
The current place request estimates the place where the user is currently located. The response contains a list of places and their associated confidence levels.
If a location is not specified in CurrentPlaceRequestParams, then the SDK retrieves the current location using android.location.LocationManager.
Parameters:
requestParams - the request parameters. See CurrentPlaceRequestParams
callback - a PlaceManager.OnRequestReadyCallback that is invoked when the GraphRequest has been created and is ready to be executed.

newCurrentPlaceFeedbackRequest

public static GraphRequest newCurrentPlaceFeedbackRequest(CurrentPlaceFeedbackRequestParams requestParams)
Creates a new current place feedback request.
This request allows users to provide feedback on the accuracy of the current place estimate. This information is used to improve the accuracy of our results.
Returns a new GraphRequest that is configured to perform a current place feedback request.
Parameters:
requestParams - the request parameters. See CurrentPlaceFeedbackRequestParams
Returns:
a GraphRequest that is ready to be executed
Throws: