Android Things doesn't have any special requirements when it comes to binding services.
I have this project https://github.com/neuberfran/SmartDrive5
The code that you are using to bind to the service in your GitHub project is incorrect. The ComponentName
constructor requires the package name of your app (not the package of the class), so your should look like this:
val driverService = ComponentName(
"com.example.neube.smartdrive",
"com.example.neube.smartdrive.controlamotores.modooffline.DriverService"
)
val serviceIntent = Intent()
serviceIntent.component = driverService
// Bind to the driver service
bindService(serviceIntent, callback, BIND_AUTO_CREATE)
Note this format is really only necessary if you are calling a service in a remote process. Since you are binding to a service from within the same app context, it's much more straightforward to construct the intent this way:
val serviceIntent = Intent(this, DriverService::class.java)
// Bind to the driver service
bindService(serviceIntent, callback, BIND_AUTO_CREATE)