The Streaming feature enables devices to capture a continuous data stream and use the data available on streaming servers. Use the Streaming API to monitor your application’s live stream data in text or JSON format.
Note: The JSON format is supported only if the streaming servers provide the valid JSON-formatted text in a single line.
Some real-world usages of the Streaming API are as follows:
Live stock market prices
Sensor data from artificial sensors on various parameters, such as Humidity and Temperature
Streaming data uses different protocols to fetch the data.
Note: Kony currently supports only the HTTP 1.1 protocol.
The Streaming API comprises of the kony.stream
Namespace
and related API elements:
Function | Description |
---|---|
kony.stream.deregisterDataStream
|
Deregisters the application that was registered earlier with the Streaming Server |
kony.stream.registerDataStream
|
Registers the application for streaming with the OS provider of the underlying platform. |
kony.stream.setCallback
|
Specifies the callback function that needs to be executed for a registered data stream. |
Register an application for streaming using the kony.stream.registerDataStream
function, and specify the callback function to be executed for a registered data stream using the kony.stream.setCallback
function. You can unregister an application from the Streaming server using the kony.stream.deregisterDataStream
function.
You can test the Streaming APIs by configuring a streaming server locally using the StreamingServer.zip and the readme.txt artefacts.
To view the functionality of the Streaming API in action, download the sample application from the link below. Once the application is downloaded, build and preview the application using the Kony Quantum App.
Copyright © 2013 Kony, Inc. All rights reserved. |