rest in peace with xamarin - filip ekberg filerest in peace with xamarin @fekberg . page ... ›...
TRANSCRIPT
![Page 1: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/1.jpg)
REST in peace with Xamarin
@fekberg
![Page 2: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/2.jpg)
Page
Contact [email protected] http://fekberg.com +61 (401) 157-608 @fekberg C# Smorgasbord
/ Copyright ©2014 by Readify Pty Ltd 2
![Page 3: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/3.jpg)
Page
What is Xamarin?
/ Copyright ©2014 by Readify Pty Ltd 3
› Enables you to reach all major mobile platforms › Gives you: › Native user interface › Native Performance › An awesome development experience
![Page 4: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/4.jpg)
Page
Developing using Xamarin
/ Copyright ©2014 by Readify Pty Ltd 4
Xamarin Studio PC or Mac
Visual Studio Plugin
VS 2010/2012/2013
![Page 5: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/5.jpg)
Page
Can we reuse code?
/ Copyright ©2014 by Readify Pty Ltd 5
› Yes! We can use PCL (Portable Class Libraries) › Different approaches: › Inject implementations › Inject Action/Func
› Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo
![Page 6: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/6.jpg)
Page
REST API?
/ Copyright ©2014 by Readify Pty Ltd 6
› Fancy way of saying API over HTTP › What REST API? iHackerNews! › http://api.ihackernews.com/
› HTTP GET -> /page returns a collection of entries public class Entry { public int Id { get; set; } public int Points { get; set; } public string PostedAgo { get; set; } public string PostedBy { get; set; } public string Title { get; set; } public string Url { get; set; } }
![Page 7: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/7.jpg)
Page
How do you use REST from C#?
/ Copyright ©2014 by Readify Pty Ltd 7
![Page 8: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/8.jpg)
Page
Performing a GET request
/ Copyright ©2014 by Readify Pty Ltd 8
var client = new HttpClient(); var result =
await client.GetStringAsync(HackerNewsApiUrls.Top);
![Page 9: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/9.jpg)
Page
DEMO! Xamarin + C# + REST
/ Copyright ©2014 by Readify Pty Ltd 9
![Page 10: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/10.jpg)
Page
Summary
/ Copyright ©2014 by Readify Pty Ltd 10
› Easy to have business logic in a shared library (PCL) › Consuming REST APIs are easy! › Xamarin makes it all enjoyable
![Page 11: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/11.jpg)
Page
Questions?
/ Copyright ©2014 by Readify Pty Ltd 11
![Page 12: REST in peace with Xamarin - Filip Ekberg fileREST in peace with Xamarin @fekberg . Page ... › Create interface IFoo in PCL inject implementation iOS.Foo and Droid.Foo . Page](https://reader030.vdocuments.net/reader030/viewer/2022041123/5d2009b888c993ec448c2716/html5/thumbnails/12.jpg)
Page
Thank you! [email protected] http://fekberg.com +61 (401) 157-608 @fekberg C# Smorgasbord
/ Copyright ©2014 by Readify Pty Ltd 12