Skip to content

Lightstreamer/Lightstreamer-example-StockList-client-Xamarin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lightstreamer -Basic Stock-List Demo - Xamarin Client

This project contains a demo application showing the integration between the Lightstreamer .Net Standard Client library and Xamarin cross-platform mobile application development tool.

Demo ScreenShot

Details

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.

Dig the Code

  • 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. This class also takes care of opening and closing the connection to the Lightstreamer server.
  • 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.

Build

To build your own version of the demo follow these steps:

  • Import the source codes of this project in a Cross-Platform Xamarin project. We have used Visual Studio 2022, that you can download from the Microsoft website.
  • You can choose the target devices between iOS and Android.
  • You should complete this project with the Lightstreamer .NET Standard Client library. Follow these steps:
    • In the "Solution Explorer" tab, right click on the project and choose Manage NuGet Packages ...
    • In the Search text box enter Lightstreamer
    • Choose Lightstreamer.DotNetStandard.Client then click Install and then Ok
  • You may run the demo against your local server or using our online server 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.
    • In the former case, note that, as prerequisite, the Lightstreamer - Stock- List Demo - Java Adapter has to be deployed on your local Lightstreamer Server instance. Please check out that project and follow the installation instructions provided with it.
  • Launch the Debug choosing your preferred platform and enjoy.

See Also

Lightstreamer Adapters Needed by This Demo Client

Related Projects

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer .NET Standard Client SDK version 6.0 and Lightstreamer Server 7.4.0.
  • Ensure that .Net Standard Client API is supported by Lightstreamer Server license configuration.
  • For instructions compatible with .NET Standard Client library version 5.x, please refer to this tag.
  • For instructions compatible with .NET Standard Client library version 4.x, please refer to this tag.

About

This is a Xamarin version of the Lightstreamer Stock-List Demos for cross-platform: androind, iOS, UWP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages