Cluster Information
Method to Check Cluster Speed
The vehicle speed displayed on the Connect cluster and the speed displayed by the app may differ. If the app calculates vehicle speed using GPS measurements, it may differ from the speed displayed on the cluster.
The Connect cluster displays vehicle speed using Google's PERF_VEHICLE_SPEED property, so to use the same speed as the cluster, read PERF_VEHICLE_SPEED with CarPropertyManager.
- Declare
Car.PERMISSION_SPEEDpermission in AndroidManifest.xml - Prepare a
Carinstance. - Obtain
CarPropertyManager. - Query the current value with
getProperty.- Subscription to change events is possible with
registerCallback.
- Subscription to change events is possible with
// Runtime permission: Car.PERMISSION_SPEED
// After preparing Car
val carPropertyManager = car.getCarManager(Car.PROPERTY_SERVICE) as CarPropertyManager
// Example: Query (API signature according to AAOS version)
val prop = carPropertyManager.getProperty(
Float::class.java,
VehiclePropertyIds.PERF_VEHICLE_SPEED,
VehicleAreaType.VEHICLE_AREA_TYPE_GLOBAL
)
val speedMps = prop?.value // Float, m/s
For detailed descriptions of the property, refer to Google's official documentation.
Method to Check Battery Information
You can check the EV battery state of charge (SOC, %) by calling the getEvBatteryStateOfCharge API of the Vehicle SDK.
The getEvBatteryStateOfCharge API returns the charge level of the electric vehicle EV battery in percentage.
@RequiresPermission(value = "pleos.car.permission.CAR_ENERGY")
abstract fun getEvBatteryStateOfCharge(
onComplete: (Int?) -> Unit,
onFailed: (Exception) -> Unit
)
Permission
- Protection level: Normal
- Permission: pleos.car.permission.CAR_ENERGY
Callback Parameters
onComplete (Int?): Called when the battery charge state is successfully retrieved. The value is the battery level (%).onFailed (Exception): Called when the battery charge state retrieval fails.
info
- This API is available from Vehicle SDK version 2.1.5.
- You must add the
pleos.car.permission.CAR_ENERGYpermission in AndroidManifest.xml.