Connected & Disconnected Apps with Xamarin

  • Published on
    23-Jan-2018

  • View
    111

  • Download
    2

Transcript

1. #XamarinDevDays 2. We Apps! 189M downloads a day 200mins on phone 127mins in apps 3. The average app user has 36 apps installed on his or her phone. 4. Only 1/4 are used daily: 5. 1/4 of apps are never used! 6. http://opensignal.com/coverage-maps 7. Shared C# codebase 100% native API access High performance iOS C# UI Windows C# UIAndroid C# UI Shared C# Mobile C# Server Linux/Mono CoreCLRAzure Shared C# Client/Server 8. RESTAPI Offline sync Facebook Twitter Microsoft Google Azure Active Directory Azure Mobile Apps WindowsAndroid Chrome iOS OSX In-AppKindle Backend code SQL MongoTables O365 API Apps Offline Sync 9. Create a Mobile Service MobileService = new MobileServiceClient( "https://myapp.azurewebsites.net"); 10. Create Tables IMobileServiceSyncTable table; public async Task Init() { const string path = "syncstore.db"; var db = new MobileServiceSQLiteStore(path); db.DefineTable(); } var handler = new MobileServiceSyncHandler(); await MobileService.SyncContext.InitializeAsync(db, h); table = MobileService.GetSyncTable(); 11. Get and Modify Data public async Task> GetStoresAsync() { await table.PullAsync("allStores", table.CreateQuery()); return await table.ToEnumerableAsync(); } public async Task AddStoreAsync (Store store) { await table.InsertAsync (store); await table.PullAsync("allStores", table.CreateQuery()); await MobileService.SyncContext.PushAsync(); return store; } 12. Lets add a backend 13. So Much More 14. Shared C# codebase 100% native API access High performance iOS C# UI Windows C# UIAndroid C# UI Shared C# Mobile C# Server Linux/Mono CoreCLRAzure Shared C# Client/Server 15. Lunch! Rui Marinho Software Engineer - Xamarin Forms rumar@microsoft.com github.com/rmarinho @ruiespinho