Configure the Woosmap MultiSearch Android SDK

Explore available parameters and understand how to combine the different autocomplete services

  1. API options
  2. Configuring a Provider
  3. Woosmap Address Provider
  4. Woosmap Localities Provider
  5. Woosmap Store Provider
  6. Google Places Provider

API options

For each API configuration you can apply the same optional parameters as defined in the dedicated REST API’s documentation.

Documentation:

Configuring a Provider

A provider is a wrapper around a Woosmap API or a Google API which will be called to return the result for a query or get details of a place. Each provider must be created from a provider configuration and this provider must then be passed to MultiSearch object by calling MultiSearch.addProvider method. Use ProviderConfig.Builder class in order to create a provider configuration.

ProviderConfig.Builder builder;
builder = new ProviderConfig.Builder(SearchProviderType.ADDRESS)
        .key(getString(R.string.woosmap_private_key))

Required Parameters

Optional Parameters

Woosmap Address Provider

To create a configuration for Woosmap Address provider use the search type parameter SearchProviderType.ADDRESS:

builder = new ProviderConfig.Builder(SearchProviderType.ADDRESS)
        .key(getString(R.string.woosmap_private_key))

Available Provider parameters

Example Woosmap Address Provider

builder = new ProviderConfig.Builder(SearchProviderType.ADDRESS)
        .key(getString(R.string.woosmap_private_key))
        .fallbackBreakPoint(0.8f)
        .minInputLength(1)
        .component(new Component(new String[]{"FR"},"fr"));
multiSearch.addProvider(builder.build());//Add Address provider

Woosmap Localities Provider

To create a configuration for Woosmap Localities provider use the search type parameter SearchProviderType.LOCALITIES:

builder = new ProviderConfig.Builder(SearchProviderType.LOCALITIES)
        .key(getString(R.string.woosmap_private_key))

Available Provider parameters

Example Woosmap Localities Provider

builder = new ProviderConfig.Builder(SearchProviderType.LOCALITIES)
        .key(getString(R.string.woosmap_private_key))
        .minInputLength(1)
        .component(new Component(new String[]{"FR"}))
        .searchType("locality")
        .searchType("country")
        .searchType("postal_code");
multiSearch.addProvider(builder.build());//Add locality provider

Woosmap Store Provider

To create a configuration for Woosmap Store provider use the search type parameter SearchProviderType.STORE:

builder = new ProviderConfig.Builder(SearchProviderType.STORE)
        .key(getString(R.string.woosmap_private_key))

Available Provider parameters

Example Woosmap Store Provider

builder = new ProviderConfig.Builder(SearchProviderType.STORE)
        .key(getString(R.string.woosmap_private_key))
        .ignoreFallbackBreakPoint(true);
multiSearch.addProvider(builder.build());//Add Store provider

Google Places Provider

To create a configuration for Google Places provider use the search type parameter SearchProviderType.PLACES:

builder = new ProviderConfig.Builder(SearchProviderType.PLACES)
        .key(getString(R.string.places_key))

Available Provider parameters

Example Google Places Provider

builder = new ProviderConfig.Builder(SearchProviderType.PLACES)
        .key(getString(R.string.places_key))
        .fallbackBreakPoint(0.7f)
        .minInputLength(1)
        .component(new Component(new String[]{"fr"}))
        .language("it");
multiSearch.addProvider(builder.build());//Add places provider                                                                language: "it"))
Was this article helpful?
Have more questions? Submit a request