A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/maps/documentation/places/android-sdk/text-search below:

Text Search (New) | Places SDK for Android

Skip to main content Text Search (New)

Stay organized with collections Save and categorize content based on your preferences.

Text Search (New) returns information about a set of places based on a string (for example, "pizza in New York" or "shoe stores near Ottawa" or "123 Main Street"). The service responds with a list of places matching the text string and any location bias that has been set.

In addition to required parameters, Text Search (New) supports refining queries using optional parameters for better results.

Text Search (New) is similar to Nearby Search (New). The main difference between the two is that Text Search (New) lets you specify an arbitrary search string while Nearby Search (New) requires a specific area in which to search.

Note: Text Search (New) is available in Places SDK for Android version 3.3.0 and later. For more information, see Choose your SDK version. For more information about using the Kotlin APIs added in version 4.0.0, see the Reference Overview. Text Search requests Note: Text Search is part of Places SDK for Android (New) and is not available in Places SDK for Android.

A Text Search request is in the form:

// Specify the list of fields to return.
final List<Place.Field> placeFields = Arrays.asList(Place.Field.ID, Place.Field.DISPLAY_NAME);

// Define latitude and longitude coordinates of the search area.
LatLng southWest = new LatLng(37.38816277477739, -122.08813770258874);
LatLng northEast = new LatLng(37.39580487866437, -122.07702325966572);

// Use the builder to create a SearchByTextRequest object.
final SearchByTextRequest searchByTextRequest = SearchByTextRequest.builder("Spicy Vegetarian Food", placeFields)
  .setMaxResultCount(10)
  .setLocationRestriction(RectangularBounds.newInstance(southWest, northEast)).build();

// Call PlacesClient.searchByText() to perform the search.
// Define a response handler to process the returned List of Place objects.
placesClient.searchByText(searchByTextRequest)
    .addOnSuccessListener(response -> {
      List<Place> places = response.getPlaces();
    });

In this example, you:

Note: For more information on initializing PlacesClient, see Initialize the Places API client.

You can use a CancellationToken to attempt to cancel a request to any of the request classes (for example, FetchPlaceRequest). Cancellation is done on a best-effort basis. Once a cancellation request is issued, no response will be returned. Issuing a cancellation token does NOT guarantee that a particular request will be cancelled, and you may still be charged for the request even if no response is returned.

Text Search responses

The SearchByTextResponse class represents the response from a search request. A SearchByTextResponse object contains:

For example, in the request you defined a field list as:

// Specify the list of fields to return.
final List<Place.Field> placeFields = Arrays.asList(Place.Field.ID, Place.Field.DISPLAY_NAME);

This field list means that each Place object in the response contains only the place ID and name of each matching place. You can then use the Place.getId() and Place.getName() methods to access these fields in each Place object.

For more examples of accessing data in a Place object, see Access Place object data fields

Required parameters

The required parameters for SearchByTextRequest are:

Optional parameters

Use the SearchByTextRequest object to specify the optional parameters for your request.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-14 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["Google Maps Places API Text Search finds places using text queries, handling imprecise addresses and finding businesses by name or type."],["Text Search supports various parameters to refine searches, like location restrictions, price levels, and open hours filters."],["Search results are ranked by relevance or distance, depending on the query and parameters used."],["Requests specify desired data fields, affecting billing based on the selected information."],["This feature is part of the Places SDK for Android (New), and developers should be aware of version differences and billing considerations."]]],["Text Search retrieves place information via a text string, supporting various queries like business names, addresses, and phone numbers. It's available on Android, iOS, JavaScript, and Web Service. Searches can be refined with location bias or restriction, maximum result count, minimum rating, open now status, price levels, rank preference, and region codes. Android implementation uses `SearchByTextRequest` and `SearchByTextResponse` within the Places SDK for Android (New), offering cancellation options. IP biasing is the default if location is not set.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4