Skip to content

Media Search

Media Search is the useful tool you need when you want to find fast a specific artist, song or playlist.

You can use the Media Cross Providers Search when you want to search for media content through one or more of your media sources.

The following sections cover how you can get started using Media Search. You can easily integrate the Media Search, by following these steps.

1. Dependencies

Open the build.gradle file for your project and add the following dependency:

1
2
3
dependencies {    
    implementation "com.telenav.sdk.vivid:android-sdk-media-search:${version}"
}

2. Sample of usage

Create Search Manager

Create instance of the search manager using the following code.

1
val searchManager = CrossProviderSearchManager.Factory.create(applicationContext)


Perform search

Use the following code in order to be able to perform search.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
coroutineScope.launch {
    searchManager
            .search(
                term = "Elvis",
                mediaProviderConfigs = listOf(
                    MediaProviderConfig(packageName = "com.spotify.music")
                )
             )
         .collect {searchResults->...handle results  }
}