This is a Xamarin version of the Lightstreamer Stock-List Demos for cross-platform: androind, iOS, UWP.
This project contains a demo application showing the integration between the Lightstreamer .Net Standard Client library and Xamarin cross-platform mobile application development tool.
This demo displays real-time market data for six stocks generated by a feed simulator and is based on Basic Stock-List Demo.
This project shows how is it possible to integrate the .Net Standard Client API for Lightstreamer into a Xamarin project, in order to quickly create cross-platform mobile apps embedding real-time technologies.
App.xaml
(and App.xaml.cs
) is the main application file; it contains application event handling code (application start, sleep, resume, etc.).MainPage.xaml
(and MainPage.xaml.cs
) is the main page of the app. Consists in a simple table containing the last price of six stocks updated in real-time (simulated); clicking or tapping into one of them open the Details page.DetailsPage.xaml
(and DetailsPage.xaml.cs
) is the Details page of the app and contains details info of a stock (Name, Last Price, Last Time, Max, Min, Best Bid, Best Ask, Change %), also all this information is real-time updated.AboutPage.xaml
and (AboutPage.xaml.cs
) is tha About page and contains a brief introduction to the demo.RTFeed.cs
class acts as a bridge between the pages and the Lightstreamer Client library, in order to subscribe the necessary Items and collect all updates in real time. Indeed this class is used as BindingContext for the visual Xamarin widgets.TestConnectionListener.cs
this class implements the ClientListener interface of Lightstreamer Client API, and receives all the information about changes in the status of the connection with the Lightstreamer server.QuoteListener.cs
and DetailsListener.cs
implement the SubscriptionListener interface of Lightstreamer Client API, and receives the reale time updates for the Items subscribed.Check out the sources for further explanations.
NOTE: Not all the functionalities of the Lightstreamer .NET Standard Client Library are exposed by the classes listed above. You can easily expand those functionalities using the .NET Standard Client API as a reference.
If in trouble, check out the Lightstreamer forum.
To build your own version of the demo follow these steps:
Manage NuGet Packages ...
Lightstreamer
Install
and then Ok
push.lightstreamer.com
. The server to which the demo will connect to is configured in the RTfeed.cs
file; by default the demo targets our demo server at http://push.lightstreamer.com.