You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
6.6 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # eShopOnContainers
  2. eShopOnContainers is a reference app whose imagined purpose is to serve the mobile workforce of a fictitious company that sells products. The app allow to manage the catalog, view products, manage the basket and the orders.
  3. <img src="Images/eShopOnContainers_Architecture_Diagram.png" alt="eShopOnContainers" Width="800" />
  4. ### Supported platforms: iOS, Android and Windows
  5. ### The app architecture consists of two parts:
  6. 1. A Xamarin.Forms mobile app for iOS, Android and Windows.
  7. 2. Several .NET Web API microservices deployed as Docker containers.
  8. ### Xamarin.Forms App (eShopOnContainers)
  9. This project exercises the following platforms, frameworks or features:
  10. * Xamarin.Forms
  11. * XAML
  12. * Behaviors
  13. * Bindings
  14. * Converters
  15. * Central Styles
  16. * Custom Renderers
  17. * Animations
  18. * IoC
  19. * Messaging Center
  20. * Custom Controls
  21. * Cross Plugins
  22. * XFGloss
  23. * xUnit Tests
  24. * Azure Mobile Services
  25. * C# backend
  26. * WebAPI
  27. * Entity Framework
  28. * Identity Server 4
  29. ## Three platforms
  30. The app targets **three** platforms:
  31. * iOS
  32. * Android
  33. * Universal Windows Platform (UWP)
  34. * UWP supported only in Visual Studio, not Xamarin Studio or Visual Studio for MacOS
  35. As of 07/03/2017, eShopOnContainers features **89.2% code share** (7.2% iOS / 16.7% Android / 8.7% Windows).
  36. ## Licenses
  37. This project uses some third-party assets with a license that requires attribution:
  38. - [Xamarin.Plugins](https://github.com/jamesmontemagno/Xamarin.Plugins): by James Montemagno
  39. - [FFImageLoading](https://github.com/daniel-luberda/FFImageLoading): by Daniel Luberda
  40. - [ACR User Dialogs](https://github.com/aritchie/userdialogs): by Allan Ritchie
  41. - [Xamarin.Forms Animation Helpers](https://github.com/jsuarezruiz/Xamanimation): by Javier Suárez
  42. - [SlideOverKit](https://github.com/XAM-Consulting/SlideOverKit): by XAM-Consulting
  43. ## Requirements
  44. ### Requirements for March 2017 version of eShopOnContainers
  45. * [Visual Studio __2015__](https://www.visualstudio.com/en-us/products/vs-2015-product-editions.aspx) (14.0 or higher) to compile C# 6 langage features (or Visual Studio MacOS)
  46. * Xamarin add-ons for Visual Studio (available via the Visual Studio installer)
  47. * __Visual Studio Community Edition is fully supported!__
  48. * [Android SDK Tools](https://developer.xamarin.com/guides/android/getting_started/installation/windows/) 25.2.3 or higher
  49. * JDK 8.0
  50. ## Setup
  51. #### [1. Ensure the Xamarin platform is installed](http://developer.xamarin.com/guides/cross-platform/getting_started/installation/)
  52. #### 2. Ensure Xamarin are updated
  53. Xamarin will periodically automatically check for updates. You can also manually check for updates.
  54. <img src="Images/Updates.png" alt="Ensure Xamarin are updated" Width="600" />
  55. ### 3. Project Setup
  56. Restore NuGet packages for the project.
  57. ### 4. Ensure Android Emulator is installed
  58. You can use any Android emulator although it is highly recommended to use an x86 based version.
  59. <img src="Images/AndroidEmulator.png" alt="Visual Studio Android Emulator" Width="600" />
  60. **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.
  61. To deploy and debug the application on a physical device, refer to these [link](https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-device/).
  62. ### 5. Ensure Mac connection
  63. To set up the Mac host, you must enable communication between the Xamarin extension for Visual Studio and your Mac.
  64. <img src="Images/MacAgent.png" alt="Connect with a Mac" Width="600" />
  65. ## Screens
  66. The app has the following screens:
  67. * a auth screen
  68. * a catalog list
  69. * a profile section with a order list
  70. * a readonly order detail screen
  71. * a customizable basket
  72. * a checkout screen
  73. <img src="Images/Auth.png" alt="Login" Width="210" />
  74. <img src="Images/Catalog.png" alt="Catalog" Width="210" />
  75. <img src="Images/Filter.png" alt="Filter catalog" Width="210" />
  76. <img src="Images/Profile.png" alt="Profile" Width="210" />
  77. <img src="Images/OrderDetail.png" alt="Order details" Width="210" />
  78. <img src="Images/ShoppingCart.png" alt="Basket" Width="210" />
  79. <img src="Images/Settings.png" alt="Settings" Width="210" />
  80. ## Clean and Rebuild
  81. If you see build issues when pulling updates from the repo, try cleaning and rebuilding the solution.
  82. ## Troubleshooting
  83. **Unsupported major.minor version 52.0**
  84. So, you just downloaded the source code and ready to build the application and...
  85. <img src="Images/Unsupported52.0.png" alt="Unsupported major.minor version 52.0" Width="600" />
  86. We have two possible fixes.
  87. The first one is based on updating Java JDK and ensure its use. 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 a 64-bit version to be able to use personal controls in the Android editor among other actions.
  88. Download the corresponding version of the JDK in this [link](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).
  89. After downloading and installing, we must ensure that the installed version is used. For that:
  90. Visual Studio: Tools> Options> Xamarin> Android Settings> Java Development Kit Location.
  91. Xamarin Studio (on Mac): Xamarin Studio> Preferences> Projects> SDK Locations> Android> Java SDK (JDK).
  92. The second way is based on using Android 6.0 or what is the same API Level 23.
  93. **Could not connect to the debugger using Android Hyper-V emulators**
  94. The application performs the deployment and even boots into the emulator, but stops immediately without allowing debugging. We get the message:
  95. <img src="Images/could-not-connect-to-the-debugger.png" alt="Could not connect to the debugger" Width="600" />
  96. The error is related with incompatibilities between the host processor and the Hyper-V virtual machine.
  97. In Windows 10, we press the start button and write MMC. Next, click the Hyper-V Manager option:
  98. <img src="Images/launch-hyperv-manager.png" alt="Could not connect to the debugger" Width="600" />
  99. In the Hyper-V machine management tool (emulators) we select the one that we want to use and we right click, Settings.
  100. <img src="Images/vm-settings.png" alt="Virtual machine settings" Width="600" />
  101. In the configuration window of the machine, go to the Compatibility section and enable **Migrate to a physical computer with a different processor version**:
  102. <img src="Images/set-compatibility-vs-sml.png" alt="Migrate to a physical computer with a different processor version" Width="600" />
  103. ## Copyright and license
  104. * Code and documentation copyright 2017 Microsoft Corp. Code released under the [MIT license](https://opensource.org/licenses/MIT).