eShopOnContainers is a reference app whose imagined purpose is to serve the mobile workforce of a fictitious company that sells products. The app would allow a user to manage their catalog, view products, manage the basket/cart and the orders.
Supported platforms: iOS, Android and Windows
The app's architecture consists of two parts:
- A Xamarin.Forms mobile app for iOS, Android and Windows.
- Several .NET Web API microservices deployed as Docker containers.
Xamarin.Forms App (eShopOnContainers)
This project exercises the following platforms, frameworks or features:
- Central Styles
- Custom Renderers
- IoC (Inversion of Control)
- Messaging Center
- Custom Controls
- Cross Plugins
- xUnit Tests
- Azure Mobile Services
- C# backend
- Entity Framework
- Identity Server 4
The app targets three platforms:
- Universal Windows Platform (UWP)
- UWP is supported only in Visual Studio, not Xamarin Studio or Visual Studio for MacOS
As of 07/03/2017, eShopOnContainers features 89.2% code sharing (7.2% iOS / 16.7% Android / 8.7% Windows).
This project uses some third-party assets with a license that requires attribution:
- Xamarin.Plugins: by James Montemagno
- FFImageLoading: by Daniel Luberda
- ACR User Dialogs: by Allan Ritchie
- Xamarin.Forms Animation Helpers: by Javier Suárez
- SlideOverKit: by XAM-Consulting
Requirements for March 2017 version of eShopOnContainers
- Visual Studio 2015 (14.0 or higher) to compile C# 6 language features (or Visual Studio for MacOS)
- Xamarin add-ons for Visual Studio (available via the Visual Studio installer)
- Visual Studio Community Edition is fully supported!
- Android SDK Tools 25.2.3 or higher
- JDK 8.0
2. Ensure Xamarin is updated
Xamarin will periodically automatically check for updates. You can also manually check for updates.
3. Project Setup
Restore NuGet packages for the project.
4. Ensure Android Emulator is installed
You can use any Android emulator, although it is highly recommended to use an x86 based version.
Note: The Visual Studio Android Emulator cannot run well inside a Virtual Machine or over Remote Desktop or VNC since it relies on virtualization and OpenGL.
To deploy and debug the application on a physical device, refer to this link.
5. Ensure Mac connection
To set up the Mac host, you must enable communication between the Xamarin extension for Visual Studio and your Mac.
The app has the following screens:
- a auth screen
- a catalog list
- a profile section with an orders list
- a readonly order detail screen
- a customizable basket
- a checkout screen
Clean and Rebuild
If you see build issues when pulling updates from the repo, try cleaning and rebuilding the solution.
Unsupported major.minor version 52.0
So, you just downloaded the source code and you are ready to build the application and ...
We have two possible fixes.
The first one is based on updating Java JDK and ensure it's being used. The version 52.0 referenced in the error refers to the JDK, specifically to version 8. Xamarin Android 7.0 requires the JDK 1.8 to use the Android Nougat APIs (API Level 24). It is also necessary for a 64-bit version to be able to use personal controls in the Android editor among other actions.
Download the corresponding version of the JDK from this link.
After downloading and installing, we must ensure that the installed version is used. For that:
Visual Studio: Tools> Options> Xamarin> Android Settings> Java Development Kit Location. Xamarin Studio (on Mac): Xamarin Studio> Preferences> Projects> SDK Locations> Android> Java SDK (JDK).
The second way is based on using Android 6.0 which is the same as API Level 23.
Could not connect to the debugger using Android Hyper-V emulators
The application performs the deployment and even boots into the emulator, but stops immediately without allowing debugging. We get the message:
The error is related with incompatibilities between the host processor and the Hyper-V virtual machine.
In Windows 10, we press the start button and write MMC, short for Microsoft Management Console. Next, click the Hyper-V Manager option:
In the Hyper-V machine management tool (emulators) we select the one that we want to use and we right click, Settings.
In the configuration window of the machine, go to the Compatibility section and enable Migrate to a physical computer with a different processor version:
Copyright and license
- Code and documentation copyright 2017 Microsoft Corp. Code released under the MIT license.