HERE Android SDK Developer's Guide

TextSuggestionRequest

The class TextSuggestionRequest is a member of com.here.android.mpa.search .

Class Summary

public class TextSuggestionRequest

extends com.here.android.mpa.search.Request, java.lang.Object

Represents an extended Request used to retrieve a List of search terms by way of Places search services.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in TextSuggestionRequest
Constructors

TextSuggestionRequest (String partialTerm)

Default constructor.

Method Summary

Table 2. Methods in TextSuggestionRequest
Methods

public ErrorCode execute (ResultListener<String> listener)

Executes an asynchronous request.

public int getCollectionSize ()

Gets the current collection size being used for request responses.

public RichTextFormatting getRichTextFormatting ()

Gets the current RichTextFormatting type being used in request responses.

public TextSuggestionRequest setCollectionSize (int value)

Sets a collection size to be used for request responses.

public TextSuggestionRequest setMapViewport (GeoBoundingBox mapViewport)

The map viewport is a bounding box of the map area currently visible to the user.

public TextSuggestionRequest setQueryText (String partialTerm)

Set the query partial search term.

public TextSuggestionRequest setRichTextFormatting (RichTextFormatting value)

Sets a RichTextFormatting to be used in request responses.

public TextSuggestionRequest setSearchCenter (GeoCoordinate center)

Sets the search center.

Class Details

Represents an extended Request used to retrieve a List of search terms by way of Places search services.

A search location context must be provided by setting either a search center using setSearchCenter(GeoCoordinate) or a bounding map viewport using Request%3CT%3E#setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an INVALID_PARAMETER when executing the request.

Constructor Details

TextSuggestionRequest (String partialTerm)

Default constructor.

Creates a request to return a list of suggested search terms that are related to a specified location context and a partial search term.

* A search location context must be provided by setting either a search center using setSearchCenter(GeoCoordinate) or a bounding map viewport using Request%3CT%3E#setMapViewport(GeoBoundingBox). Failing to set a map viewport will result in an INVALID_PARAMETER when executing the request.

Parameters:

  • partialTerm

Method Details

public ErrorCode execute (ResultListener<String> listener)

Executes an asynchronous request.

Parameters:

  • listener

    A ResultListener passed along with the request to monitor progress

Returns:

The ErrorCode representing an appropriate result

public int getCollectionSize ()

Gets the current collection size being used for request responses.

Returns:

The current response collection size

public RichTextFormatting getRichTextFormatting ()

Gets the current RichTextFormatting type being used in request responses.

Returns:

The current RichTextFormatting type

public TextSuggestionRequest setCollectionSize (int value)

Sets a collection size to be used for request responses. The maximum number of result items in each collection will be limited to this value. The valid value range is [1..100]. The default collection size is 20.

Parameters:

  • value

    Desired response collection size per request.

Returns:

This Request%3CT%3E object

Throws:

  • IllegalArgumentException

    if size is out of range.

public TextSuggestionRequest setMapViewport (GeoBoundingBox mapViewport)

The map viewport is a bounding box of the map area currently visible to the user. The viewport can act as an implicit location context in the absence of an explicit location context. To ensure you get the best results possible, you should always set a viewport if there is a map visible to the user.

Parameters:

  • mapViewport

    The bounding box of the map area currently visible.

public TextSuggestionRequest setQueryText (String partialTerm)

Set the query partial search term.

Parameters:

  • partialTerm

    A partial search term used to create a list of suggested search terms.

Returns:

The TextSuggestionRequest.

public TextSuggestionRequest setRichTextFormatting (RichTextFormatting value)

Sets a RichTextFormatting to be used in request responses. The default formatting is HTML.

Parameters:

  • value

    Desired RichTextFormatting

Returns:

This TextSuggestionRequest object

public TextSuggestionRequest setSearchCenter (GeoCoordinate center)

Sets the search center.

Parameters:

  • center

    The GeoCoordinate representing the location context used to search for nearby places.

Returns:

The TextSuggestionRequest.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.