Upload
chris-koenig
View
1.430
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
Data and NetworkingChris [email protected] @chriskoenig | http://chriskoenig.net
WIRELESS: softlayer - techwild
Windows Phone
30-to-Launch Program OverviewSession 1
• Overview of Windows Phone• Metro Design• Tour: Expression Blend
• Tour: Visual Studio
• Building, Running and Debugging Your First App
• Online Resources
• Signup for Marketplace
Session 2
• Exploring Windows Phone Capabilities• Live Tiles • Sensors & Camera
• Launchers• Choosers• Search Integration
• Advertisements
Session 3
• Working with Data• App Resources• Isolated Storage
• Database• Networking Stack
• Social Integration
Session 4
• Windows Phone Marketplace• Application submittal process
• How to handle rejection
• Promoting your application
• Help submitting your app to the Marketplace
2
Windows Phone
Today’s Agenda
Proxomo Isolated Storage Databases on Windows Phone Networking Stack Social Sharing
3
Proxomo
Isolated Storage
Windows Phone
Isolated Storage
Demo
http://github.com/chriskoenig/isolatedstorage
Using Isolated Storage in Windows Phone
Databases
Windows Phone
SQL Server on Windows Phone Based on SQL Server Compact Edition 3.5 Runtime is distributed with the operating
system Interaction managed through LINQ to SQL’s
code-first model Create classes that represent tables Annotate classes and fields/properties
with[Table] and [Column] attributes
Create a custom DataContext object to manage interactions
Automatic conversion of data types Properties are available
Encrypt the database using a password on the connection string9
Windows Phone
Local Data Storage: OverviewApps store private data in Isolated Storage
Settings and properties in the app dictionaryUnstructured data in Isolated Storage files Structured data in database files
ApplicationSettings file
AppCreates/managesfiles and settings
Applicationfiles
App Data Folder
Package Manager
App Root Folder
WP7 Isolated Storage APIs
Install
DBDatabase file
Databasefile (r/o)
Creates root folder
sandboxed to App
DB
10
Windows Phone
DB
DataContextName Little
Penguin
Varietal Pinot Noir
AtHome True
Inserts/Updates/Deletes Actions made on the objects and
collections Create new objects Add objects to collections
Managed by the DataContext Changes made against
the DataContext first Changes persisted
by calling SubmitChanges() SubmitChanges
LINQ to SQL determines change set and submits to DB
Name Little Penguin
Varietal Pinot Noir
AtHome False
Your app code
Name Yellow Tail
Varietal Pinot Noir
AtHome True
11
Demo
http://github.com/chriskoenig/databaseformango
Using SQL CE for Windows Phone
Networking Stack
Windows Phone
Networking Stack
WebClient HttpWebRequest /
HttpWebResponse XML JSON Custom14
Windows Phone15
WebClient
Simple API DownloadStringComplete DownloadStringAsync
GET verb Anonymous authentcation Runs on the UI Thread
Windows Phone
HttpWebRequest
More complex api Access to the request stream and
response stream Support all HTTP verbs Support basic authentication Runs on the background thread
Windows Phone
XML
Located in System.Xml.Linq namespace
XDocument LINQ to XML
Windows Phone
JSON
No built-in support for JSON (ish) Recommended to use JSON.NET
JsonConvert.Deserialize<T> JsonConvert.Serialize()
Demo
http://github.com/chriskoenig/NetworkingXmlAndJson
Networking with XML and JSON
Social Integration
Windows Phone
Sharing with…
Defined Social Networks (i.e. Twitter, Facebook) Share from your app
ShareLinkTask ShareStatusTask
Integrate into Windows Phone Photos_Extra_Hub Photos_Extra_Share
Demo
http://github.com/chriskoenig/socialsharing
Social Sharing with Windows Phone
Windows Phone
Homework
Start wrapping up your project
Test on the device
Start generating the required images
Ping me for help with roadblocks
23
BeMyAppDallas
Feb 24-26, 2012
register
http://bemyappdallas.eventbrite.com/
AT&T Mobile App Hackathon!Come build your mobile app with us. We will have 5+ senior mobile application developers that will be directly assisting you with your mobile application development efforts. Come to network. Come to learn. Come to hang out!
Where? AT&T Foundry - 2900 West Plano Parkway, Plano, TX 75075
When? Friday Feb 17th at 6PM and all day Saturday!
http://mobileappdfw2.eventbrite.com
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
© 2011 Microsoft Corporation.
All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.