xamarin
play

Xamarin One platform to rule them all? Erwin de Groot @ 040 coders - PowerPoint PPT Presentation

Xamarin One platform to rule them all? Erwin de Groot @ 040 coders .NET frameworks WPF UI SL UI UWP UI iOS UI Android UI MacOS UI Libraries Libraries Libraries Libraries Libraries Libraries Mono Mono Touch Android .NET .NET


  1. Xamarin One platform to rule them all? Erwin de Groot @ 040 coders

  2. .NET frameworks WPF UI SL UI UWP UI iOS UI Android UI MacOS UI Libraries Libraries Libraries Libraries Libraries Libraries Mono Mono Touch Android .NET .NET Xamarin. … framework Silverlight Mac Xamarin. Xamarin. iOS Android .NET Core

  3. .NET standard WPF UI SL UI UWP UI iOS UI Android UI MacOS UI Libraries .NET standard interface .NET .NET Xamarin. Xamarin. Xamarin. .NET Core framework Silverlight iOS Android Mac

  4. Xamarin Forms Linux UWP iOS Android macOS Shared UI Xamarin Forms Mono & Xamarin. Xamarin. Xamarin. .NET Core GTK# iOS Android Mac

  5. Xamarin

  6. Xamarin history

  7. Xamarin & alternatives C#, XAML C++, QML C#, UnityScript, Boo Javascript, HTML5, CSS3 Open source MIT license Open source (L)GPL Proprietary Open source Apache License - Still maturing - No native controls - Focus on games - Slow UI - No native controls - No native controls + Customizable native + Mature rich UI + Great for games/3D + Fast development controls development

  8. Visual Studio Xamarin Solution

  9. From WPF to Xamarin.Forms WPF Xamarin.Forms Control Templates Rendering classes WPF names: Xamarin.Forms names: UserControl ContentView StackPanel StackLayout ScrollViewer ScrollView DataContext BindingContext Extended Binding functionality Basic Binding functionality ComboBox Picker ToolTips, Menu, ContextMenu -

  10. User Interface rendering UI (XAML) StackLayout Button Xamarin.Forms StackLayout StackLayout StackLayout StackLayout Renderer Renderer Renderer Renderer Button Button Button Button Renderer Renderer Renderer Renderer UWP Android iOS macOS Xamarin Bindings StackPanel LinearLayout UIStackView NSStackView Button Button UIButton NSButton

  11. Custom renderers

  12. Custom renderers

  13. Xamarin.Forms.DependencyService

  14. Xamarin.Forms.DependencyService

  15. Xamarin.Forms.DependencyService

  16. Xamarin.Forms.DependencyService

  17. My development setup Mac mini - Visual Studio for Mac - iOS emulators Laptop - Visual Studio Community - Android emulators iPhone SE Android phone (borrowed) iPad Air 2

  18. Encountered issue #1 Deploying app to a device or simulator yields: “Couldn't connect to logcat, GetProcessId returned: 0” No idea what causes this, but when you uninstall the app from the device/simulator and try again, it works.

  19. Encountered issue #2 Dunno. Try again.

  20. Encountered issue #3 Latest Xamarin doesn’t support old .net standard anymore. Increase the ‘minimum supported windows version’ in the UWP app.

  21. Encountered issue #4 .NET and Java each have their own garbage collection. What happens when you process a bunch of large (native) bitmaps? .NET Java Call ‘Dispose()’ on the bitmap when not used anymore, or use the ‘using’ construct. Listen to the ‘ OnTrimMemory ’ event and invoke the .NET Garbage Collection yourself.

  22. Encountered issue #5 Compiler keeps complaining that the iOS app requires a LaunchScreen, but the LaunchScreen is there! ‘iPad multitask’ is a new option starting from iOS 11 and also happens to be enabled default. Somehow this causes the strange ‘ LaunchScreen ’ error. Simply disable the option.

  23. Encountered issue #6 Xamarin.Forms 3.3.0 and up: removing a custom control from the macOS page causes a NullReferenceException. Issue is known, but not solved yet. Revert back to Xamarin.Forms 3.2.0 SkiaSharp 1.60.3 and older: when a canvas has size 0x0, an OutOfMemoryException occurs Upgrade SkiaSharp to 1.68.0 SkiaSharp 1.68.0 requires Xamarin.Forms 3.3.0

  24. In conclusion: did Xamarin help? Flexibility • Custom renderers • • DependencyService A single UI definition • • Once set-up, quickly add features too all platforms. • Xamarin.macOS hasn’t matured yet Open source so you can fix it yourself • • Xamarin & community are pretty fast picking up issues Visual differences between platforms sometimes look awkward • You really need those custom renderers •

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend