HERE Android SDK Developer's Guide

DiscoveryRequest

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

Class Summary

public class DiscoveryRequest

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

Represents an extended Request used to retrieve a DiscoveryResultPage object by way of Places search services.

[For complete information, see the section Class Details]

See also:

ExploreRequest

HereRequest

SearchRequest

Constructor Summary

Table 1. Constructors in DiscoveryRequest
Constructors

DiscoveryRequest ()

DiscoveryRequest (PlacesDiscoveryRequest impl)

Field Summary

Table 2. Fields in DiscoveryRequest
Fields

protected CategoryFilter m_categoryFilter

protected List<android.util.Pair<java.lang.Integer, java.lang.Integer>> m_imageDimensions

protected GeoBoundingBox m_searchArea

protected GeoCoordinate m_searchCenter

protected int m_searchRadius

Method Summary

Table 3. Methods in DiscoveryRequest
Methods

public void addImageDimensions (int width, int height)

Request Image Media with specific dimensions.

public DiscoveryRequest addReference (String name)

This function adds the name of a requested reference identifiers to be returned in the results.

public ErrorCode execute (ResultListener<DiscoveryResultPage> eventListener)

Executes an asynchronous request.

This method overrides search.Request.execute(ResultListener)

public int getCollectionSize ()

Gets the current collection size being used for request responses.

public List getReferences ()

This function returns the names of requested reference identifiers to be returned in the results.

public RichTextFormatting getRichTextFormatting ()

Gets the current RichTextFormatting type being used in request responses.

protected DiscoveryRequest setCategoryFilter (CategoryFilter filter)

public DiscoveryRequest setCollectionSize (int value)

Sets a collection size to be used for request responses.

public DiscoveryRequest setMapViewport (GeoBoundingBox mapViewport)

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

public DiscoveryRequest setRichTextFormatting (RichTextFormatting value)

Sets a RichTextFormatting to be used in request responses.

protected DiscoveryRequest setSearchArea (GeoCoordinate coordinate, int radius)

protected DiscoveryRequest setSearchArea (GeoBoundingBox area)

protected DiscoveryRequest setSearchCenter (GeoCoordinate coordinate)

Class Details

Represents an extended Request used to retrieve a DiscoveryResultPage object by way of Places search services.

See also:

ExploreRequest

HereRequest

SearchRequest

Constructor Details

DiscoveryRequest ()

DiscoveryRequest (PlacesDiscoveryRequest impl)

Parameters:

  • impl

Field Details

protected CategoryFilter m_categoryFilter

protected List<android.util.Pair<java.lang.Integer, java.lang.Integer>> m_imageDimensions

protected GeoBoundingBox m_searchArea

protected GeoCoordinate m_searchCenter

protected int m_searchRadius

Method Details

public void addImageDimensions (int width, int height)

Request Image Media with specific dimensions. At least one of the sizes (width or height) needs to be valid (greater than 0).

Parameters:

  • width

    Image width (pass 0 for any width)

  • height

    Image height (pass 0 for any height)

public DiscoveryRequest addReference (String name)

This function adds the name of a requested reference identifiers to be returned in the results.

For example, to retrieve an POI identifier (pvid), set this value to PVID_ID_REFERENCE_NAME.

Parameters:

  • name

    Name of reference identifier to retrieve.

Returns:

True if name added, false otherwise.

See also:

http://places.hybrid.api.here.com/places/static/doc/public/#topics/external-references.html

Request <T> #PVID_ID_REFERENCE_NAME

Request <T> #VENUES_ID_REFERENCE_NAME

Request <T> #VENUES_CONTENT_ID_REFERENCE_NAME

Request <T> #VENUES_DESTINATION_ID_REFERENCE_NAME

Request <T> #VENUES_VENUE_ID_REFERENCE_NAME

public ErrorCode execute (ResultListener<DiscoveryResultPage> eventListener)

Executes an asynchronous request.

This method overrides search.Request.execute(ResultListener)

Parameters:

  • eventListener

public int getCollectionSize ()

Gets the current collection size being used for request responses.

Returns:

The current response collection size

public List getReferences ()

This function returns the names of requested reference identifiers to be returned in the results.

Returns:

List of the names of reference identifiers to be returned in the result.

public RichTextFormatting getRichTextFormatting ()

Gets the current RichTextFormatting type being used in request responses.

Returns:

The current RichTextFormatting type

protected DiscoveryRequest setCategoryFilter (CategoryFilter filter)

Parameters:

  • filter

public DiscoveryRequest 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 DiscoveryRequest 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 DiscoveryRequest setRichTextFormatting (RichTextFormatting value)

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

Parameters:

  • value

    Desired RichTextFormatting

Returns:

This DiscoveryRequest object

protected DiscoveryRequest setSearchArea (GeoCoordinate coordinate, int radius)

Parameters:

  • coordinate
  • radius

protected DiscoveryRequest setSearchArea (GeoBoundingBox area)

Parameters:

  • area

protected DiscoveryRequest setSearchCenter (GeoCoordinate coordinate)

Parameters:

  • coordinate