Uvod u Realm za Almir Vuk Uvod u Realm za Xamarin Almir Vuk O meni

• Almir Vuk • .NET Developer • IT/DEV Blogger • Microsoft Student Partner • Student FIT-a • Programming since 2011 Traditional development – SILO Approach

Build Apps Multiple Times

• Multiple Teams • Multiple Code Bases • Different toolsets What is Xamarin? Is platform for native developpment on iOS, Android, Mac and Windows (UWP, WP & Windows Store) Apps using Visual Studio and C# Xamarin Platform

• Two approaches: • Xamarin.Forms • Xamarin.Android/Xamarin.iOS (Traditional) What is Xamarin.Forms? Xamarin + Xamarin.Forms

iOS C# UI Android C# UI Windows C# UI Shared UI Code

Shared C# Backend Shared C# Backend

Traditional Xamarin With Xamarin.Forms: Approach More code-sharing, all native Xamarin.Forms: What’s included

✓ 40+ Pages, layouts, and controls (Build from code behind or XAML) Shared UI Code ✓ Two-way data binding ✓ Navigation ✓ Animation API Shared C# Backend ✓ Dependency Service ✓ Messaging Center Visual Studio templates

Built in project templates in Visual Studio Under Cross-Platform section. PCL vs Shared project PCL & Shared project Which one to use?

 Pros: • Pros  All APIs directly available  Platform-specific logic can be added directly  All file types can be shared  Cons • Cons  Can lead to spaghetti code  Harder to unit test when conditional code is used  Must be shiped as source code Project Structure Project Structure - Dependencies Xamarin.Forms App anatomy

Xamarin.Forms application have two required components which are provided by the template Pages Page is abstract class used to define single screen of content

Content MasterDetail Navigation Tabbed Carousel Layouts containers

Stack Absolute Relative Grid ContentView ScrollView Frame Controls (Views)

ActivityIndicator BoxView Button DatePicker Editor

Entry Image Label ListView Map

OpenGLView Picker ProgressBar SearchBar Slider

Stepper TableView TimePicker WebView EntryCell

ImageCell SwitchCell TextCell ViewCell Native UI from shared code

xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyApp.MainPage">