connecting to data from windows phone 8
Embed Size (px)
DESCRIPTION
TRANSCRIPT
- 1. Connecting to Data from Windows Phone 8 Chris Woodruff Director, Perficient Level: Intermediate to Advanced
2. Who I am? Chris Woodruff MVP, Visual C# Director at Perficient Co-host of Deep Fried Bytes Podcast @cwoodruff / [email protected] / Skype: cwoodruff 3. You will learn: Understand the benefits of using REST web services for your mobile appsHave an understanding to develop solutions against OData that will give better experiences for your usersHow to shape your data queries to give the best performance for your mobile appsA glimpse into using Windows Azure Mobile Services to also get to your data in the cloud. 4. LETS TAKE A REST 5. What is REST? REST is an architectural style for distributed hypermedia systemsREpresentational State TransferThe term originated in 2000 by Roy Fielding for his PhD thesisREST states that the existing protocols and principles of the web are enough to create robust Web Services no SOAP is needed 6. What does REST consist of? REST is a very simple architecture: Application state and functionality is divided into resources. Every resource is uniquely addressable using a universal syntax for hypermedia links All resources share a uniform interface for the transfer of state between a client and a resource 7. What does REST consist of? Characteristics of REST Clientserver Stateless Cacheable Uniform Interface Named Resources Interconnected Resource Representations Layered SystemOperations of REST GET POST PUT DELETE 8. Example of REST Query a Resource http://www.parts-depot.com/parts/getPart?id=00345http://www.parts-depot.com/parts/00345http://restbucks.com/PlaceOrder?coffee={type}&size= {size}&milk={milk}&location={location} 9. DIGGING INTO ODATA 10. Open Data Protocol (OData) RESTful Web protocol Designed to work with data across HTTP Built on existing Web standards Uses popular formats to return data payloads to consumer Uses self-describing metadata Has multiple options to build implementation based on standard protocol Soon to be a full web standard 11. The Basics of OData Feeds, which are Collections of typed EntitiesOData services can expose Actions and Services OData services expose all these constructs via URIs OData service may also expose a Service Metadata Document 12. Full SQL like Query LanguageHTTP Command (Verb) GETSQL Command SELECTPUTUPDATEPOSTINSERTDELETEDELETE 13. What is an OData URI loo like? http://services.odata.org/OData/OData.svc _______________________________________/ | service root URI http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name _______________________________________/ __________________/ _________________/ | service root URI| resource path| query options 14. OData Best Practices (Producer) Always design your OData feed will server-side paging if your entity collections hold large amounts of data. Looks at server-side validation of queries and data updates based on the user credentials sent through HTTP 15. Why are we excited!! 16. ODATA AND HOW TO CONSUME IT IN WINDOWS PHONE 17. DEMO Windows Phone and OData 18. OData Best Practices (Consumer) Use Query Projection to only bring back the entity properties you or your app needs. Think about client-side paging even if their exists server-side paging. Design and implement a client-side data caching function in your app (unless sensitive data). 19. AZURE MOBILE SERVICES AND HOW TO CONSUME IT IN WINDOWS PHONE 20. DEMO Windows Phone and Azure Windows Services 21. The demo projects can be found at:github.com/cwoodruff/ 22. ResourcesREST http://www.ics.uci.edu/~taylor/documents/ 2002-REST-TOIT.pdfOData http://odata.orghttp://odataprimer.com Azure Mobile Services http://www.windowsazure.com/enus/develop/mobile/ 23. Contact MeChris Woody Woodruff [email protected] Twitter @cwoodruff Skype cwoodruff http://chriswoodruff.comhttp://deepfriedbytes.com