building connected android apps chris risner technical evangelist microsoft @chrisrisner

of 30 /30
Building Connected Android Apps Chris Risner Technical Evangelist Microsoft http://chrisrisner.com @chrisrisner

Upload: laureen-hensley

Post on 12-Jan-2016

285 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Building Connected Android Apps

Chris RisnerTechnical EvangelistMicrosoft

http://chrisrisner.com@chrisrisner

Page 2: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

• Let’s build an app!• How Microsoft got here?• Mobile Services• Features and demos• Win a prize• Questions

What we’re going to talk about

Page 3: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Let’s build an app!

Page 4: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

How Microsoft got here?

Page 5: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

What we had

Cloud services

Storage Identity

Page 6: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

What we neededCross Platform Features

Page 7: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

What we made

Page 8: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Auth

What is Windows Azure Mobile Services?

Data

NotificationsServer Logic

Scheduler

Logging & Diag

Scale

Page 9: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Getting Started a backend for your mobile app in minutes Demo

Page 10: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Structured StorageStructured Storage with SQL DatabaseSame DB – multiple Mobile Services

AppX.Todoitem

AppY.Todoitem

Manage data inPortal, SQL Portal

SQL Management Studio

REST API

CLI Tools

Page 11: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

JSON to SQL type mappings

JSON Value T-SQL Type

Numeric values (integer, decimal, floating point)

Float

Boolean Bit

DateTime DateTimeOffset(3)

String Nvarchar(max)

Page 12: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Server Logic

Automatic REST API generated for storageDynamic Schema on/offAbility to customize server logic that intercepts table requests

Page 13: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Server LogicSupported Modules + Globals

requestconsolepush.*tablesmssqlstatusCodesazurestore (pusher, sendgrid, twilio, etc)

mssql.query('select top 1 * from statusupdates', { success: function(results) { console.log(results);

} }

);

Page 14: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Server Logicadding server logic on CRUD

operations Demo

Page 15: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Push Notification Lifecycle Overview 1. Register for push

notifications

2. Send Registration ID to Mobile Service

3. Push from server side scripts

Android

(1)

(2)

(3)

(3)

Page 16: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Push NotificationsDemo

Page 17: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

User Auth

Page 18: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Auth Data and ScriptsTable level permissions for each CRUD operation

EveryoneAnyone with the Application KeyOnly Authenticated UsersOnly Scripts and Admins

More granular control with server side scriptsuser.level: {admin, authenticated, anonymous}user.userId: id or undefined if not authenticated

Page 19: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Adding Authenticationintegrating with Google Demo

Page 20: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Command Line ToolsCreate servicesDelete servicesCreate (with auth options), update, delete, list tablesUpload, delete, download, list scriptsGet configuration

Page 21: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Using the CLI Demo

Page 22: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

SchedulerExecute scripts on a Schedule

by Minutes

by Hours

by Days

By Months

Execute scripts on DemandExamples Periodic purge of old data

Poll and aggregate from 3rd party (Twitter, RSS, others)

Process/resize images

Schedule sending push notifications for a given time of day

Page 23: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Scheduling a taskAdding Todo Items Demo

Page 24: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Diagnostics, Logging and Scale

DiagnosticsAPI callsCPU TimeData Out

Loggingconsole.error(…)console.log(…)…

Scale - ComputeScale out instance countScale up VM size

Scale - StorageScale out mobile service tenant to dedicated SQL DBScale up SQL DB

Page 25: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Diagnostics, Logging, Scale

Demo

Page 26: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Pricing Example:

10 x Mobile Services on shared instances

100MB SQLDatabase

Unlimited data in

<165MB daily out

How?10 FREE mobile services on shared instanceIncludes 165MB/day of FREE data out from API calls Cost - All services sharing a 100MB DB is $5 USD / Month Use Pricing Calculator to Estimate your costs

=$5/ Month

Note: Free data out is per subscription, not per mobile service

Page 27: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Auth

Summary

Data

NotificationsServer Logic

Scheduler

Logging & Diag

Scale

Page 28: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Win a JamBox

• Complete the Quick Start challenge

• 1 extra entry for showing use of Auth

• 3 extra entries for showing use of push

• Winner announced on 4/18

e-mail: [email protected]

Page 29: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

The QuickStart Challenge

• Sign up for the free trial at www.windowsazure.com/android

• Complete the Mobile Services QuickStart

• Send me an image (including your account e-mail in the corner)

• Entries must be submitted by Thursday 1pm PST

• E-mail [email protected]

Page 30: Building Connected Android Apps Chris Risner Technical Evangelist Microsoft  @chrisrisner

Useful ResourcesGet a Windows Azure Free Trial Accounthttp://www.windowsazure.com/

Learn moreFind videos, tutorials and more at https://www.windowsazure.com/android

Help with Mobile ServicesQ&A Forum: Windows Azure Mobile Services ForumFeature Rqst: Windows Azure Mobile Services UserVoiceFeedback: [email protected]: @chrisrisner

Presentations, demos, hands on labsWindows Azure Training Kit: Download here