Online vs. offline

To use online or offline search, simply set searchService on the SearchRequest object. If there is no internet connection, offline search will be used as a fallback. For offline search, you need to have offline maps downloaded.

Result types

There are different types of search results such as MapSearchResult - there is a place in map, that matches query, CoodrinateSearchResult - query was recognized as geographical coordinates. Other types are for data inserted to search via sdk, such as contacts or recent places. From MapSearchResult, you can retrieve its data type and various text fields such as getCity() and GetStreet(). From the fields you can also extract what part of it was matched by query, eg. to add highlighting. The MapSearchResult only has an approximate position that can be used to calculate coarse distance with SearchResult.distanceFrom(). To get exact position, you need to get details as shown below.

Details

To load details such as exact position of a result from sdk, you have to use MapSearchResult. Based on its type, MapSearchResult can be cast to its sybtypes such as DetailCity or DetailPoi to obtain relevant information for that type.

When you don't need listen dor search result, you can unregister listener by calling

mSearch.removeSearchResultsListener(mListener);

Places

You can search Points Of Interest (POI) near a location via Places api. By defining PoiInfo.PoiCategory or PoiInfo.PoiGroup you can search places of certain type (eg. find restaurants around user). All places can be searched by passing PoiInfo.PoiGroup.Unknown.