The Barcode control (added to the Telerik UI for Xamarin toolkit with the R2 2018 release) enables you to quickly generate the most commonly used types of barcodes in your Android, iOS and UWP mobile applications. This blog post aims to familiarize you with the key features of the control and shows you how to easily include the element within your application in a matter of seconds.
Let me start off by showing you an example of a generated barcode used within a custom view that we created for our Xamarin Sample Application:
This image is a snapshot of the SpecialOffer example, which is available in the QSF Sample Application. You can check the QSF application (located in the QSF folder within your local Telerik UI for Xamarin installation) for more examples that include different Barcode scenarios.
First, let"s have a look at the key features the control provides:
RadBarcodeprovides three sizing modes that will help you fine-tune the rendering of your codes.
BackgroundColorproperties that can be used to customize its visual appearance.
Visualizing a QR code requires only five XAML lines:
<barcode:RadBarcode Value=" http://www.telerik.com/"> <barcode:RadBarcode.Symbology> <symbology:QRCode /> </barcode:RadBarcode.Symbology> </barcode:RadBarcode>
The result from adding the above code to your XAML is the following barcode:
To show your barcode with the perfect quality (no matter the screen density), you could use one of the three sizing modes:
As you can see, the API of the control is quite simple and it is very easy to include it in your application. We encourage you to give it a try and boost the effectiveness of your application with minimum effort from your side.
More information regarding the control’s capabilities can be found in the official documentation page of the Telerik UI for Xamarin suite—BarCode Overview. Don't forget to check the available examples in the QSF as well as the SDK Samples Browser applications.
As always, your feedback regarding the control would be greatly appreciated. Any suggestions are welcomed so we can make the process of integrating any type of barcodes within your Xamarin application as smooth and easy as possible.
Subscribe to be the first to get our expert-written articles and tutorials for developers!