Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
The Top Reasons You Need to
Learn about Data Before you
Develop Your Mobile App
CHRIS WOODRUFF
Chris Woodruff
EMAIL
cwoodruff@live.com
SKYPE
cwoodruff
TWITTER
cwoodruff
PHONE
616.724.6885
Agenda
The Top Reasons You Need to Learn about Data in Your Windows Phone App
://
HTTP
1 UNDERSTAND HTTP
PROTOCOL
WEB
SERV...
UNDERSTAND HTTP PROTOCOL
The Top Reasons You Need to Learn about Data in Your Windows Phone App
WHAT SHOULD YOU KNOW ABOUT HTTP?
Resources
These are the URLs you use to get to pages on the
web
Request Headers
These are...
HOW DOES HTTP WORK?
GET CODEMASH.COM
http://www.codemash.com/index.html
WHAT DOES THE BROWSER DO?
GET /index.html HTTP/1.0...
HTTP VERBS
GET
Requests a representation of the specified
Requests using GET should only retrieve
have no other effect.
HE...
HTTP RESONSE CODES
1XX
Request received, continuing process.
This class of status code indicates a
consisting only of the ...
COMMON HTTP RESONSE CODES
The Top Reasons You Need to Learn about Data in Your Windows Phone App
101 Switching Protocols -...
COMMON HTTP RESONSE CODES
The Top Reasons You Need to Learn about Data in Your Windows Phone App
400 Bad Request - The syn...
UNDERSTAND WEB SERVICES
The Top Reasons You Need to Learn about Data in Your Windows Phone App
Types of Web Services
01
02
04
03
Simple Object Access protocol (SOAP)
Representational State Transfer (REST)
Remote Proce...
EVOLUTION OF WEB SERVICES?
The Top Reasons You Need to Learn about Data in Your Windows Phone App
UNDERSTAND REST
The Top Reasons You Need to Learn about Data in Your Windows Phone App
WHAT IS REST?
RESOURCES
VERBS
URL
The Top Reasons You Need to Learn about Data in Your Windows Phone App
WHAT SHOULD YOU KNOW ABOUT REST?
Resources
REST uses addressable resources to define the
structure of the API. These are t...
REST & HTTP VERBS
GET
Requests a representation of the specified
Requests using GET should only retrieve
have no other eff...
EXAMPLES OF REST
/Products
RESOURCE EXPECTED OUTCOMEVERB RESPONSE CODE
/Products?Color=green
/Products
/Products/81
/Produ...
SWAGGER UI
The Top Reasons You Need to Learn about Data in Your Windows Phone App
BENEFITS
GENERATE CLIENT CODE BASED ON Y...
Testing REST Web Services
The Top Reasons You Need to Learn about Data in Your Windows Phone App
BROWSER
DEVELOPER
EXTENSI...
DEMO
The Top Reasons You Need to Learn about Data in Your Windows Phone App
http://baseball-stats.info/api/Teams
KNOW HOW TO CACHE DATA
IN THE APP
The Top Reasons You Need to Learn about Data in Your Windows Phone App
01
02
04
03
LOCAL
Data that exists on the current device
backed up in the cloud.
APP DATA STORAGE
The Top Reasons You Need...
DATA TYPES FOR CACHING
UInt8, Int16, UInt16, Int32,
UInt32, Int64, UInt64, Single,
Double
Boolean
Char16, String DateTime,...
EXAMPLES OF DATA CACHING
LOCALSETTINGS
The Top Reasons You Need to Learn about Data in Your Windows Phone App
Windows.Stor...
EXAMPLES OF DATA CACHING
LOCALFOLDER
The Top Reasons You Need to Learn about Data in Your Windows Phone App
Windows.Storag...
EXAMPLES OF DATA CACHING
The Top Reasons You Need to Learn about Data in Your Windows Phone App
TEMPORARYFOLDER
Windows.St...
EXAMPLES OF DATA CACHING
The Top Reasons You Need to Learn about Data in Your Windows Phone App
void InitHandlers()
{
Wind...
SQL AND NOSQL DATA SOLUTIONS
SQLite
A relational database management system contained in a C
contrast to other database ma...
PICK AND USE A GOOD MVVM
FRAMEWORK
The Top Reasons You Need to Learn about Data in Your Windows Phone App
BEAUTY OF MVVM
The Top Reasons You Need to Learn about Data in Your Windows Phone App
MODEL VIEWVIEW MODEL
DEMO
The Top Reasons You Need to Learn about Data in Your Windows Phone App
LEARN GREAT UX AND HOW TO SHOW
DATA IN YOUR APP
The Top Reasons You Need to Learn about Data in Your Windows Phone App
EXAMPLES OF DATA VIZ
The Top Reasons You Need to Learn about Data in Your Windows Phone App
BOOKS ABOUT DATA VIZ
The Top Reasons You Need to Learn about Data in Your Windows Phone App
FINALLY!!
CHRIS WOODRUFF
SKYPE
CWOODRUFF
TWITTER
CWOODRUFF
WEBSITE
CHRISWOODRUFF.COM
EMAIL
CWOODRUFF@LIVE.COM
PHONE
616.724.6885
LIN...
The Top Tips You need to Learn about Data in your Mobile App
The Top Tips You need to Learn about Data in your Mobile App
The Top Tips You need to Learn about Data in your Mobile App
The Top Tips You need to Learn about Data in your Mobile App
The Top Tips You need to Learn about Data in your Mobile App
The Top Tips You need to Learn about Data in your Mobile App
Upcoming SlideShare
Loading in …5
×

The Top Tips You need to Learn about Data in your Mobile App

701 views

Published on

You know you have to have a great experience when you develop your iOS, android and Windows Phone applications right? The greatest experience you can give your users is around their data.

Published in: Technology
  • Be the first to comment

The Top Tips You need to Learn about Data in your Mobile App

  1. 1. The Top Reasons You Need to Learn about Data Before you Develop Your Mobile App CHRIS WOODRUFF
  2. 2. Chris Woodruff EMAIL cwoodruff@live.com SKYPE cwoodruff TWITTER cwoodruff PHONE 616.724.6885
  3. 3. Agenda The Top Reasons You Need to Learn about Data in Your Windows Phone App :// HTTP 1 UNDERSTAND HTTP PROTOCOL WEB SERVICES 2 UNDERSTAND WEB SERVICES REST 3 UNDERSTAND REST DATA CACHING 4 KNOW HOW TO CACHE DATA IN THE APP MVVM 5 PICK AND USE A GOOD MVVM FRAMEWORK DATA VIZ 6 LEARN HOW TO SHOW DATA IN YOUR APP
  4. 4. UNDERSTAND HTTP PROTOCOL The Top Reasons You Need to Learn about Data in Your Windows Phone App
  5. 5. WHAT SHOULD YOU KNOW ABOUT HTTP? Resources These are the URLs you use to get to pages on the web Request Headers These are additional instructions that are sent with the request. These might define what type of response is required or authorization details. Request Verbs These describe what you want to do with the resource. A browser typically issues a GET verb to instruct the endpoint it wants to get data, however there are many other verbs available including things like POST, PUT and DELETE. Request Body Data that is sent with the request. For example a POST (creation of a new item) will required some data which is typically sent as the request body in the format of JSON or XML. Response Body This is the main body of the response. If the request was to a web server, this might be a full HTML page. Response Status codes These codes are issues with the response and give the client details on the status of the request. The Top Reasons You Need to Learn about Data in Your Windows Phone App
  6. 6. HOW DOES HTTP WORK? GET CODEMASH.COM http://www.codemash.com/index.html WHAT DOES THE BROWSER DO? GET /index.html HTTP/1.0 From: cwoodruff@live.com User-Agent: HTTPTool/1.0 [blank line here] WHAT IS THE RESPONSE? HTTP/1.0 200 OK Date: Thu, 8 Jan 2015 3:30:00 GMT Content-Type: text/html Content-Length: 1354 <html> <body> </body> </html> The Top Reasons You Need to Learn about Data in Your Windows Phone App
  7. 7. HTTP VERBS GET Requests a representation of the specified Requests using GET should only retrieve have no other effect. HEAD Asks for the response identical to the one that would correspond to a GET request, but without the response body. POST Requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI. PUT Requests that the enclosed entity be stored under the supplied URI. DELETE Deletes the specified resource. PATCH Applies partial modifications to a resource The Top Reasons You Need to Learn about Data in Your Windows Phone App TRACE Echoes back the received request so that a client can see what (if any) changes or additions have been made by intermediate servers. OPTIONS Returns the HTTP methods that the server supports for the specified URL.
  8. 8. HTTP RESONSE CODES 1XX Request received, continuing process. This class of status code indicates a consisting only of the Status-Line and and is terminated by an empty line. 2XX This class of status codes indicates the action requested by the client was received, understood, accepted and processed successfully. 3XX This class of status code indicates the client must take additional action to complete the request. 4XX The 4xx class of status code is intended for cases in which the client seems to have errored. 5XX The server failed to fulfill an apparently valid request. Response status codes beginning with the digit "5" indicate cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request. The Top Reasons You Need to Learn about Data in Your Windows Phone App
  9. 9. COMMON HTTP RESONSE CODES The Top Reasons You Need to Learn about Data in Your Windows Phone App 101 Switching Protocols - Tells the client that the server will switch protocols to that specified in the Upgrade message header field during the current connection. For example, when requesting a page, a browser might receive a status code of 101, followed by an "Upgrade" header showing that the server is changing to a different version of HTTP. 200 OK - The request sent by the client was successful. 202 Accepted - The request has been accepted for processing, but has not yet been processed. 204 No Content - The request was successful but does not require the return of an entity-body. 301 Moved Permanently - The resource has permanently moved to a different URI. 302 Found - The requested resource has been found under a different URI but the client should continue to use the original URI. 303 See Other - The requested response is at a different URI and should be accessed using a GET command at the given URI. 304 Not Modified - The resource has not been modified since the last request.
  10. 10. COMMON HTTP RESONSE CODES The Top Reasons You Need to Learn about Data in Your Windows Phone App 400 Bad Request - The syntax of the request was not understood by the server. 401 Not Authorized - The request needs user authentication. 403 Forbidden - The server has refused to fulfill the request. 404 Not Found - The document/file requested by the client was not found. 405 Method Not Allowed - The method specified in the Request-Line is not allowed for the specified resource. 407 Proxy Authentication Required - The request first requires authentication with the proxy. 500 Internal Server Error - The request was unsuccessful due to an unexpected condition encountered by the server. 502 Bad Gateway - The server received an invalid response from the upstream server while trying to fulfill the request. 503 Service Unavailable - The request was unsuccessful due to the server being down or overloaded. 504 Gateway Timeout - The upstream server failed to send a request in the time allowed by the server.
  11. 11. UNDERSTAND WEB SERVICES The Top Reasons You Need to Learn about Data in Your Windows Phone App
  12. 12. Types of Web Services 01 02 04 03 Simple Object Access protocol (SOAP) Representational State Transfer (REST) Remote Procedure Call (RPC) Calls over HTTP The Top Reasons You Need to Learn about Data in Your Windows Phone App
  13. 13. EVOLUTION OF WEB SERVICES? The Top Reasons You Need to Learn about Data in Your Windows Phone App
  14. 14. UNDERSTAND REST The Top Reasons You Need to Learn about Data in Your Windows Phone App
  15. 15. WHAT IS REST? RESOURCES VERBS URL The Top Reasons You Need to Learn about Data in Your Windows Phone App
  16. 16. WHAT SHOULD YOU KNOW ABOUT REST? Resources REST uses addressable resources to define the structure of the API. These are the URLs you use to get to pages on the web Request Headers These are additional instructions that are sent with the request. These might define what type of response is required or authorization details. Request Verbs These describe what you want to do with the resource. A browser typically issues a GET verb to instruct the endpoint it wants to get data, however there are many other verbs available including things like POST, PUT and DELETE. Request Body Data that is sent with the request. For example a POST (creation of a new item) will required some data which is typically sent as the request body in the format of JSON or XML. Response Body This is the main body of the response. If the request was to a web server, this might be a full HTML page, if it was to an API, this might be a JSON or XML document. Response Status codes These codes are issues with the response and give the client details on the status of the request. The Top Reasons You Need to Learn about Data in Your Windows Phone App
  17. 17. REST & HTTP VERBS GET Requests a representation of the specified Requests using GET should only retrieve have no other effect. POST Requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI. PUT Requests that the enclosed entity be stored under the supplied URI. DELETE Deletes the specified resource. The Top Reasons You Need to Learn about Data in Your Windows Phone App
  18. 18. EXAMPLES OF REST /Products RESOURCE EXPECTED OUTCOMEVERB RESPONSE CODE /Products?Color=green /Products /Products/81 /Products/881 /Products/81 /Products/81 GET GET POST GET GET PUT DELETE A list of all products in the system A list of all products in the system where the color is red Creation of a new product Product with an ID of 81 Some error message Update of the product with ID of 81 Deletion of the product with ID of 81 200/OK 200/OK 201/Created 200/OK 404/Not Found 204/No Content 204/No Content The Top Reasons You Need to Learn about Data in Your Windows Phone App
  19. 19. SWAGGER UI The Top Reasons You Need to Learn about Data in Your Windows Phone App BENEFITS GENERATE CLIENT CODE BASED ON YOUR SWAGGER KEEPS YOUR API FULLY DOCUMENTED UNDERSTAND REST API QUICKLY UPDATED WHEN YOU BUILD YOUR API
  20. 20. Testing REST Web Services The Top Reasons You Need to Learn about Data in Your Windows Phone App BROWSER DEVELOPER EXTENSIONS Web-based REST/Web Services Clients FIDDLER Free web debugging tool which logs all HTTP(S) traffic between your computer and the Internet. LINQPAD Interactively query SQL databases (among other data sources such as OData or WCF Data Services) using LINQ, as well as interactively writing C# code without the need for an IDE. SoapUI SoapUI is an open-source web service testing application for service-oriented architectures (SOA) and representational state transfers (REST). Its functionality covers web service inspection, invoking, development, simulation and mocking, functional testing, load and compliance testing.
  21. 21. DEMO The Top Reasons You Need to Learn about Data in Your Windows Phone App http://baseball-stats.info/api/Teams
  22. 22. KNOW HOW TO CACHE DATA IN THE APP The Top Reasons You Need to Learn about Data in Your Windows Phone App
  23. 23. 01 02 04 03 LOCAL Data that exists on the current device backed up in the cloud. APP DATA STORAGE The Top Reasons You Need to Learn about Data in Your Windows Phone App LOCALCACHE Persistent data that exists only on the current device. ROAMING Data that exists on all devices on which the user has installed the app. TEMPORARY Data that could be removed by the system at any time.
  24. 24. DATA TYPES FOR CACHING UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, Double Boolean Char16, String DateTime, TimeSpan GUID, Point, Size, Rect ApplicationDataCompositeValue The Top Reasons You Need to Learn about Data in Your Windows Phone App Note that there is no binary type. If you need to store binary data, use an app file
  25. 25. EXAMPLES OF DATA CACHING LOCALSETTINGS The Top Reasons You Need to Learn about Data in Your Windows Phone App Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; localSettings.Values["exampleSetting"] = "Hello Windows"; Windows.Storage.ApplicationDataCompositeValue composite = new Windows.Storage.ApplicationDataCompositeValue(); composite["intVal"] = 1; composite["strVal"] = "string"; localSettings.Values["exampleCompositeSetting"] = composite; Object value = localSettings.Values["exampleSetting"]; Windows.Storage.ApplicationDataCompositeValue composite = (Windows.Storage.ApplicationDataCompositeValue)localSettings.Values["exampleCompositeSetting"]; localSettings.Values.Remove("exampleSetting");
  26. 26. EXAMPLES OF DATA CACHING LOCALFOLDER The Top Reasons You Need to Learn about Data in Your Windows Phone App Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; Windows.Globalization.DateTimeFormatting.DateTimeFormatter formatter = new Windows.Globalization.DatetimeFormatting.DateTimeFormatter("longtime"); StorageFile sampleFile = await localFolder.CreateFileAsync("dataFile.txt", CreateCollisionOption.ReplaceExisting); await FileIO.WriteTextAsync(sampleFile, formatter.Format(DateTime.Now)); StorageFile sampleFile = await localFolder.GetFileAsync("dataFile.txt"); String timestamp = await FileIO.ReadTextAsync(sampleFile);
  27. 27. EXAMPLES OF DATA CACHING The Top Reasons You Need to Learn about Data in Your Windows Phone App TEMPORARYFOLDER Windows.Storage.StorageFolder temporaryFolder = Windows.Storage.ApplicationData.Current.TemporaryFolder; Windows.Globalization.DateTimeFormatting.DateTimeFormatter formatter = new Windows.Globalization.DatetimeFormatting.DateTimeFormatter("longtime"); StorageFile sampleFile = await temporaryFolder.CreateFileAsync("dataFile.txt", CreateCollisionOption.ReplaceExisting); await FileIO.WriteTextAsync(sampleFile, formatter.Format(DateTime.Now)); StorageFile sampleFile = await temporaryFolder.GetFileAsync("dataFile.txt"); String timestamp = await FileIO.ReadTextAsync(sampleFile);
  28. 28. EXAMPLES OF DATA CACHING The Top Reasons You Need to Learn about Data in Your Windows Phone App void InitHandlers() { Windows.Storage.ApplicationData.Current.DataChanged += new TypedEventHandler<ApplicationData, object>(DataChangeHandler); } void DataChangeHandler(Windows.Storage.ApplicationData appData, object o) { // Refresh your data } ROAMINGFOLDER
  29. 29. SQL AND NOSQL DATA SOLUTIONS SQLite A relational database management system contained in a C contrast to other database management systems, SQLite is not separate process that a client program running in another is part of the using program. The Top Reasons You Need to Learn about Data in Your Windows Phone App
  30. 30. PICK AND USE A GOOD MVVM FRAMEWORK The Top Reasons You Need to Learn about Data in Your Windows Phone App
  31. 31. BEAUTY OF MVVM The Top Reasons You Need to Learn about Data in Your Windows Phone App MODEL VIEWVIEW MODEL
  32. 32. DEMO The Top Reasons You Need to Learn about Data in Your Windows Phone App
  33. 33. LEARN GREAT UX AND HOW TO SHOW DATA IN YOUR APP The Top Reasons You Need to Learn about Data in Your Windows Phone App
  34. 34. EXAMPLES OF DATA VIZ The Top Reasons You Need to Learn about Data in Your Windows Phone App
  35. 35. BOOKS ABOUT DATA VIZ The Top Reasons You Need to Learn about Data in Your Windows Phone App
  36. 36. FINALLY!!
  37. 37. CHRIS WOODRUFF SKYPE CWOODRUFF TWITTER CWOODRUFF WEBSITE CHRISWOODRUFF.COM EMAIL CWOODRUFF@LIVE.COM PHONE 616.724.6885 LINKEDIN CHRIS.WOODRUFF THANK YOU

×