Java API for Android
Last updated
Last updated
On Android, the Cortex library provides an API written in Java. It contains three classes:
to load the Cortex library
to initialize the Cortex library
to send and receive JSON messages to the Cortex library
On Android, the basic workflow of the API is as follow:
Create an object from the class and call its load method
Call the static method start of the class
Create an object from the class
Call the method registerResponseHandler of the object
Call the method sendRequest of the object to send JSON messages to the Cortex library. You can call this methods as many times as necessary. Cortex will respond asynchronously, using the handler you provided at step 4. Please check the to know the format of the JSON messages.
Call the static method stop of the class