AndroidServiceConfig

data class AndroidServiceConfig(val androidServiceName: String) : Serializable

Defines the reference to an Android service.

Standard Android service (non IVI service hosts) are not managed by the IVI platform in any way. The IVI build config only allows the Android service to be deployed in a configurable process name. For instance, it is possible to deploy an Android service in the same process as an IVI service host without the need to hardcode the process name of the Android service in the AndroidManifest.xml file. To do this you need to deploy an AndroidServiceConfig in a RuntimeDeploymentConfigurator.Global with RuntimeDeploymentConfigurator.Global.deployAndroidService.

Example

val androidService = AndroidServiceConfig("com....Service")
val someServiceHost = IviServiceHostConfig(...)

ivi {
application {
enabled = true
services {
addHost(someServiceHost)
}
globalRuntime {
create(RuntimeDeploymentIdentifier.global) {
applyDefaultDeployments(all())
deployServiceHost(someServiceHost)
deployAndroidService(androidService).inSameProcessAs(someServiceHost)
}
}
}
}

The above example deploys com....Service in the same process as the someServiceHost.

Note: The IVI build config does not manage the Gradle dependencies to include the referenced Android service into the build.

Parameters

androidServiceName

The name of the Service subclass that implements the service. This should be a fully qualified class name.

This value needs to match the android:name attribute of the corresponding Android manifest service element. See service-element for details.

Constructors

Link copied to clipboard
constructor(androidServiceName: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard