Live charging metrics are currently implemented throught the use of a continuously polling GET request /transactions/{transactionId} that fetches live data every few seconds.
-
The use of the endpoint can be found in the class RemoteTransaction as a function named retrive().
-
In MainActivity, retrive() is then being called from the function setupChargingInProgressDialog()
-
To stop the current transaction we call on the stop() function from RemoteTransaction which uses the PUT endpoint transactions/stop/{transactionId}.
-
stop() is then being called from our stopChargingProcess() in MainActivity
The live charging metrics was originally retrived with the use of WebSockets which should be the case for future implementations since it is a more optimal way of handling data.