Upload
cecil-spencer
View
222
Download
0
Embed Size (px)
Building Android Apps with Windows Azure Mobile ServicesChris RisnerTechnical EvangelistMicrosoft
http://chrisrisner.com@chrisrisner
Windows Azure Mobile ServicesDataPush NotificationsAuthSchedulerDiagnostics & Scale
Agenda
@chrisrisner
What is Windows Azure Mobile Services?
Data
Notifications
Auth
Server Logic
Scheduler
Logging & Diag
Scale
@chrisrisner
Getting Started a backend for your mobile app in minutes Demo
Structured StorageStructured Storage with SQL DatabaseIf using single database apps are partitioned by schema
AppX.Todoitem
AppY.Todoitem
Manage data inPortal, SQL Portal
SQL Management Studio
REST API
CLI Tools
@chrisrisner
Server Logic
Automatic service REST API generated for storageDynamic Schema on/offAbility to author server logic that intercepts CRUD operation pipeline
@chrisrisner
Server Logic
Supported Modules + GlobalsmssqlrequestconsolepushtablesstatusCodes
mssql.query('select top 1 * from statusupdates', { success: function(results) { console.log(results);
} }
);
@chrisrisner
REST API to SQL type mappings
JSON Value T-SQL Type
Numeric values (integer, decimal, floating point)
Float
Boolean Bit
DateTime DateTimeOffset(3)
String Nvarchar(max)
@chrisrisner
Server Logicadding server logic on CRUD
operations Demo
Push Notification Lifecycle Overview 1. Register with GCM
2. Register with your send reg. ID to Mobile Service
3. Push from server side scripts
Android
(1)
(2)
(3)
(3)
@chrisrisner
Push NotificationsDemo
Auth*Authenticate against multiple providersTable 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@chrisrisn
er
Adding Authenticationintegrating with Twitter Demo
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
@chrisrisner
Scheduling a taskDeliver a push notification Demo
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
@chrisrisner
Diagnostics, Logging, Scale
Demo
Pricing during Preview
reserved modeservice level agreements
PreviewNo availability SLA*
General Availability99.9%
Shared Instance
Small instance is the only size available
Free - 10 applications with unlimited inbound data. Capped max of 165MB outbound data/day
Pay - SQL Database
Private VM
Small instance is the only size available
Free - unlimited inbound data. 165MB outbound data/day, excess charged.
Pay - SQL Database, Compute same reduced rate as Web Sites i.e 33% discount, excess outbound transfers starting at $0.12/GB
Up to 100 applications
shared mode
@chrisrisner
Pricing Example:
10 x Mobile Services on shared instances
100MB SQLDatabase
Unlimited ingress
<165MB daily egress
How?10 FREE mobile services on shared instanceIncludes 165MB/day of FREE egress 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 Egress is per subscription, not per mobile service
Don’t forget: Member OffersMSDN Subscribers up to $3700 / yearBizSpark members up to $3700 / yearMPN Members up to $1500 / yearWebsiteSpark up to $1500 / year
Full details here - http://www.windowsazure.com/en-us/pricing/member-offers/
@chrisrisner
Summary
Data
Notifications
Auth
Server Logic
Scheduler
Logging & Diag
Scales
@chrisrisner
Useful ResourcesGet a Windows Azure Free Trial Accounthttp://www.windowsazure.com/
Learn more & try tutorialsTutorials, Samples, Reference Docs: http://www.windowsazure.com/mobile
Help with Mobile ServicesQ&A Forum: Windows Azure Mobile Services ForumFeature Rqst: Windows Azure Mobile Services UserVoiceFeedback: [email protected]: @chrisrisner and @cloudnick
Presentations, demos, hands on labsWindows Azure Training Kit: Download here
More Useful ResourcesAndroid SDK on GitHubhttps://github.com/goldshtn/wams-android
Common Mobile Services How Toshttp://aka.ms/CommonWAMS
[email protected] or @chrisrisner
© 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.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.