CarConnect is build to power your company to locate, unlock, and get information from cars across brands with one single API. The library provides a secure and fast way to authenticate a car to your service.
implementation 'com.github.Jesse-Appwise:Carconnect-SDK-Android:ab91c59675'Before accessing any functions of the SDK you must register a clientID
CarConnect.register("your_client_id_here")To start the process of grating access to a car
val startForResult = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result: ActivityResult ->
if (result.resultCode == Activity.RESULT_OK) {
val intent = result.data
val tokens = intent?.getStringExtra(Authentication.RESULT_TOKENS)
}
}CarConnect.getInstance().authenticationIntent(this, AuthenticationOptions("username", "optional_brand"))
startForResult.launch(intent)Get a list of available brands
CarConnect.getInstance().brands { result ->
when(result){
is CarConnectResult.Success -> Log.d("CarConnect", result.value.toString())
is CarConnectResult.Failure -> Log.e("CarConnect", result.message ?: "-", result.throwable)
}
}