26
Data and Networking Chris Koenig [email protected] 214-385-5616 @chriskoenig | http://chriskoenig.net RELESS: softlayer - techwild

30-To-Launch #3 - Data and Networking

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: 30-To-Launch #3 - Data and Networking

Data and NetworkingChris [email protected] @chriskoenig | http://chriskoenig.net

WIRELESS: softlayer - techwild

Page 2: 30-To-Launch #3 - Data and Networking

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

Page 3: 30-To-Launch #3 - Data and Networking

Windows Phone

Today’s Agenda

Proxomo Isolated Storage Databases on Windows Phone Networking Stack Social Sharing

3

Page 4: 30-To-Launch #3 - Data and Networking

Proxomo

Page 5: 30-To-Launch #3 - Data and Networking

Isolated Storage

Page 6: 30-To-Launch #3 - Data and Networking

Windows Phone

Isolated Storage

Page 7: 30-To-Launch #3 - Data and Networking

Demo

http://github.com/chriskoenig/isolatedstorage

Using Isolated Storage in Windows Phone

Page 8: 30-To-Launch #3 - Data and Networking

Databases

Page 9: 30-To-Launch #3 - Data and Networking

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

Page 10: 30-To-Launch #3 - Data and Networking

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

Page 11: 30-To-Launch #3 - Data and Networking

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

Page 12: 30-To-Launch #3 - Data and Networking

Demo

http://github.com/chriskoenig/databaseformango

Using SQL CE for Windows Phone

Page 13: 30-To-Launch #3 - Data and Networking

Networking Stack

Page 14: 30-To-Launch #3 - Data and Networking

Windows Phone

Networking Stack

WebClient HttpWebRequest /

HttpWebResponse XML JSON Custom14

Page 15: 30-To-Launch #3 - Data and Networking

Windows Phone15

WebClient

Simple API DownloadStringComplete DownloadStringAsync

GET verb Anonymous authentcation Runs on the UI Thread

Page 16: 30-To-Launch #3 - Data and Networking

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

Page 17: 30-To-Launch #3 - Data and Networking

Windows Phone

XML

Located in System.Xml.Linq namespace

XDocument LINQ to XML

Page 18: 30-To-Launch #3 - Data and Networking

Windows Phone

JSON

No built-in support for JSON (ish) Recommended to use JSON.NET

JsonConvert.Deserialize<T> JsonConvert.Serialize()

Page 19: 30-To-Launch #3 - Data and Networking

Demo

http://github.com/chriskoenig/NetworkingXmlAndJson

Networking with XML and JSON

Page 20: 30-To-Launch #3 - Data and Networking

Social Integration

Page 21: 30-To-Launch #3 - Data and Networking

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

Page 22: 30-To-Launch #3 - Data and Networking

Demo

http://github.com/chriskoenig/socialsharing

Social Sharing with Windows Phone

Page 23: 30-To-Launch #3 - Data and Networking

Windows Phone

Homework

Start wrapping up your project

Test on the device

Start generating the required images

Ping me for help with roadblocks

23

Page 24: 30-To-Launch #3 - Data and Networking

BeMyAppDallas

Feb 24-26, 2012

register

http://bemyappdallas.eventbrite.com/

Page 25: 30-To-Launch #3 - Data and Networking

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

Page 26: 30-To-Launch #3 - Data and Networking

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.