Maps SDK fuzzy search not functional?


Is the new TomTom SDK for Android even functional? The following code:

val client = OnlineSearchApi.create(context, "API_KEY_PLACEHOLDER")
val query = "Stockholm"
val queryOptions = FuzzySearchOptions.Builder(query).build()
val result = client.fuzzySearch(queryOptions)

always results in a FuzzySearchError with no message to describe what went wrong. As far as I can tell I’ve followed the exact method outlined in your guide, and the API key works as expected when doing raw API calls to the search endpoint.

Am I doing something wrong or is this SDK not actually deployed and functional yet?

Hi Felix,
Thank you for reaching out.

You are probably using synchronous OnlineSearchApi on the main thread, which throws an error. (we are going to improve/add message in future versions). This is due to Android disallowing network calls on the main thread.
So either move to the background thread or try our asynchronous API as described in here:
Quickstart | TomTom SDK for Android