Automotive API


The Automotive API is built as a pure Java project. The way one gets hold of the API is through the automotive service, that encapsulates all Android specific code in the AGA stack. The API in itself however will remain stable.

The Automotive API classes and functions are part of the com.swedspot.automotiveapi package.

Usage


to get hold of the API:

final AutomotiveManager api = AutomotiveFactory.createAutomotiveManagerInstance(certificate, automotiveListener, driverDistractionListener);

or on ROM:

final AutomotiveManager api = (AutomotiveManager) context.getSystemService(Context.AUTOMOTIVE_SERVICE);

to register for vehicle signal updates:

api.register(signalIds);​

request a one time value:

api.requestValue(signalId);​

unregister for vehicle signals:

api.unregister(signalIds);

write vehilce signal:

final AutomotiveSignal speedSignal = new AutomotiveSignal(AutomotiveSignalId.FMS_WHEEL_BASED_SPEED, new Uint16(42), AutomotiveUnit.KILOMETERS_PER_HOUR);
api.send(speedSignal);

Code


All code is published in the automotive-api.git repo.