Xamarin Apps with Business Central integration – Part I
I know that PowerApps and PowerApps Portal are the future but in this post I want to talk about the possibility of creating apps developed on Xamarin Framework connected to Dynamics 365 Business Central; the connection happens through the consumption of Web Services and OData, as already seen also for the Web Applications (take a look to my old post MVC Web Apps with Business Central Integration)
Xamarin was acquired by Microsoft a few years ago (2016) and is currently available in Visual Studio (and also in Visual Studio Community Edition 2019)
Xamarin VS Flutter – Battlecard
If you want to see the differences between Xamarin (Microsoft) and Flutter (Google) we point out this very interesting post:
You can find a nice Battlecard between Xamarin & Flutter.
PowerApps and PowerApps Portal
Example: a simple PowerApps Application:
“wsItemList” exposed Odata source connected to Business Central, one page demo layout. A lot of great features are today available in PowerApps!
…but, as already mentioned, in this this I want to talk about Xamarin….
About Xamarin: what is Xamarin?
“Xamarin is an open-source platform for building modern and performant applications for iOS, Android, and Windows with .NET. Xamarin is an abstraction layer that manages communication of shared code with underlying platform code. Xamarin runs in a managed environment that provides conveniences such as memory allocation and garbage collection.”.
Xamarin applications can be written on PC or Mac and compile into native application packages, such as an “.apk” file on Android, or an “.ipa” file on iOS.
Xamarin is for… ???
Xamarin is for developers with the following goals:
- Share code, test and business logic across platforms.
- Write cross-platform applications in C# with Visual Studio.
is a library that provides cross-platform APIs for native device features. Like Xamarin itself, Xamarin.Essentials is an abstraction that simplifies the process of accessing native functionality.
Some examples of functionality provided by Xamarin.Essentials include:
- Device info
- File system
- Phone dialer
- Screen lock
is an open-source UI framework. Xamarin.Forms allows developers to build iOS, Android and Windows applications from a single shared codebase. Xamarin.Forms allows developers to create user interfaces in XAML with code-behind in C#. These user interfaces are rendered as performant native controls on each platform.
Some examples of features provided by Xamarin.Forms include:
- XAML user-interface language
NICE XAMARIN.FORMS EXAMPLES HERE
Xamarin Apps with Business Central integration
For example it is possible to use Xamarin to create an application that can read data via WS “OData”, load it into Xamring.forms, update data via Odata, an APP which can be used on multiple platforms (Available for Windows, Android, iOS).
- Crate\configure a New Project
A PROJECT LAYOUT LIKE THIS: A MULTIFORM APP
- Example for multiforms project with TABS, you can create more tabs (forms) to launch other pages from a master browser form like this example.
Global APP Configuration (Package appmanifest file)
You can use a Global APP Configuration to configure the application (ex; Rotation, Language, Visive Assests, exposed features)
SIMPLE DEMO APPLICATION: “Warehouse Management”
A simple application to declare Consumptions, Reclassifications movements in Business Central via Xamarin.Forms; you can add more features to manage Inventory etc. etc.
Packages and APIs
Dependencies & Lib in Project
- Application Forms
“WS CONNECTION” SAMPLE
public bool Login()
var response=WsConnection(“https://api.businesscentral.dynamics.com/v1.0/<Tenant ID>/ODataV4/Company(‘Company’)/login”);
if (response.StatusCode == System.Net.HttpStatusCode.OK)
“LOGIN PAGE” SAMPLE
…wait for part II of this post to see the APP in action on Windows and Android.
See you soon in “Xamarin Apps with Business Central integration – Part II”!