Woosmap MultiSearch Android SDK

Basics and first steps to set the MultiSearch on Android.

  1. Installation
  2. Implementing the MultiSearch Object


How to get a Git project into your build:

Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }

Step 2. Add the dependency

dependencies {
        implementation 'com.github.WebGeoServices:multisearch-android:tag'

Implementing the MultiSearch Object

The library requires to set a key for each available API in your MultiSearch implementation, whether it’s a Woosmap API or for Google Places API.

Please refer to the documentation to get an API Key if necessary.

Additionally, for each provider configuration you can apply the same optional parameters as defined in the corresponding provider documentation.

When instantiating the Multisearch object, you need, at least, to specify your desired autocomplete services’ API keys and the order in which these services will be called:

Create MultiSearch object

MultiSearch multiSearch = new MultiSearch(getApplicationContext());

Then, create ProviderConfig objects by using ProviderConfig.Builder class and add provider to MultiSearch object.

ProviderConfig.Builder builder;

builder = new ProviderConfig.Builder(SearchProviderType.LOCALITIES)
multiSearch.addProvider(builder.build());//Add locality provider

builder = new ProviderConfig.Builder(SearchProviderType.STORE)
multiSearch.addProvider(builder.build());//Add Store provider

builder = new ProviderConfig.Builder(SearchProviderType.ADDRESS)
multiSearch.addProvider(builder.build());//Add Address provider

builder = new ProviderConfig.Builder(SearchProviderType.PLACES)
multiSearch.addProvider(builder.build());//Add Places provider

APIs will be called based on the order in which they were provided to MultiSearch object. In above code snippet following will be the order of the APIs:


Specify debounceTime

Debounce time is the amount of time in miliseconds the autocomplete function will wait after the last received call before executing the next one. If no value is specified then autocomplete function will not wait for the next excecution call. You can specify debounce time by setting setDebounceTime property.


Setting up callback listener

MultiSearch returns the autocomplete and details result using MultiSearchListener callback interface. This interface has two callback methods.

MultiSearchListener multiSearchListener = new MultiSearchListener() {
    public void onSearchComplete(List<AutocompleteResponseItem> searchResult, WoosmapException exception) {
        if (exception==null){ //Check if no exception has occured during the autocomplete 
            Log.d("Multisearch","Result count is: " + searchResult.size());
            Log.d("Multisearch","Exception is: " + exception.getMessage());

    public void onDetailComplete(DetailsResponseItem detailResult, WoosmapException exception) {
        if (exception==null){ //Check if no exception has occured during the autocomplete 
            Log.d("Multisearch","Detail id is: " + detailResult.getId());
            Log.d("Multisearch","Exception is: " + exception.getMessage());


Retrieve suggestions

You can retrieve suggestions from the user input by calling the autocompleteMulti method:


Get Details

Finally, to get the suggestion details when a user selects one from the pick list, call the detailsMulti method. This method accepts two parameters.

Was this article helpful?
Have more questions? Submit a request