I love Xamarin.Forms. It’s one of the core features released in Xamarin 3, giving you the ability to build beautiful, native UIs for iOS, Android, and Windows Phone from a single shared C# codebase. To show Xamarin.Forms in action, we created a cloud-connected, fully functioning CRM app for iOS, Android and Windows Phone to demonstrate the power of Xamarin.Forms. Today, we’re making the source code available to you.
VervetaCRM is a mobile CRM app for salespeople at a fictional office-supply company (named after the vervet monkey). The app lets mobile salespeople track their sales performance, see their contacts, view customer location maps, and capture orders with user signatures. Even with these complex, cross-platform requirements, we were able to get over 90% code re-use. Watch this short video in full-screen to dive into the code and see VervetaCRM working on iOS, Android and Windows Phone.
To fulfill enterprise requirements and add complex features, it relies on several components and libraries:
Azure Mobile Services: this app uses Azure Mobile Services (AMS) as the cloud backend for authentication and data. It integrates with Azure Active Directory to create a consistent sign-on experience for mobile users. The AMS component simplifies the implementation and uses oAuth to both authenticate a user and provide a token.
Data is synchronized with an Azure SQL cloud database and a SQLite database that runs on the device – providing fast, offline data access and a consistent data access API.
OxyPlot: this is an outstanding, open-source .NET-based plotting and charting library that shows sales performance with basic graphs.
Signature Pad: available from the Xamarin Component Store to capture and display user signatures. This component highlights Xamarin.Forms extensibility; using custom renderers, it was easy to consume the platform-specific signature pad components into the Xamarin.Forms shared UI code.
Download the Code
The code is available for download on GitHub at https://github.com/xamarin/vervetacrm.
Here are some additional links to help get you started with Xamarin.Forms apps:
- Xamarin.Forms: overview and developer documentation
- Xamarin.Forms Dependency Service for accessing native device hardware features
- Live training from mobile experts available through Xamarin University