Building an Interactive Application
Building an Interactive Application
Initializing the Application
sf.service.SmartRemote.init(iRemote_input);
In which:
- init
- This function is for initializing the API for sending and receiving the data from/to the smart device. The application subscribes to the events of the smart device.
- iRemote_input
- This method receives XML metadata string from the smart device and calls the parser to parse the response of the XML Data.
Note
The function name can be decided by the developer.
Destroying the Application
sf.service.SmartRemote.destroy();
In which destroy is the function which unsubscribes the interactive API so that the application stops receiving any events from the smart device.
Parsing the Input of the Smart Phone
sf.service.SmartRemote.parse(str);
In which:
- parse
- This function calls the built-in parser to receive the input from the smart device.
- str
- The response received from the smart device.