Create your CarAppService and Session

Your app must extend the CarAppService class and implement its onCreateSession method, which returns a Session instance that corresponds to the current connection to the host:

class HelloWorldService : CarAppService() {
    override fun onCreateSession(sessionInfo: SessionInfo): Session {
        return HelloWorldSession()
    }
    // ...
}

The Session instance returns which Screen instance to use when the app is started for the first time:

class HelloWorldSession : Session() {
    override fun onCreateScreen(intent: Intent): Screen {
        return HelloWorldScreen(carContext)
    }
}

When your car app must start from a screen that isn't the Home or Landing screen, such as when handling deep links, you can use ScreenManager.push before returning from onCreateScreen to pre-seed a back stack of screens. Pre-seeding allows users to navigate back to previous screens from the first screen displayed by your app.