Been searching for a week now, The official documentation are not clear at all.
as mentioned there, the code
val searchServiceConnection = SearchServiceManager.createAndBind(context,
searchServiceConnectionCallback)
should initialize the search API in the application. but it is not clear how to use it after this.
I installed and initialized the API in the proper way :
Gradle:
//library required for search
implementation("com.tomtom.online:sdk-search:2.4264")
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
AndroidManifest
<meta-data
android:name="OnlineSearch.Key"
android:value="your-tomtom-key" />
I assume that you have a proper API key inside the AndroidManifest.xml file. Given above you can start playing with TomTom Search API in three steps:
Create the SearchAPI object:
Create the Search query object:
Call Search API and catch the results inside a listener: