Windows Azure Mobile Services
Upcoming SlideShare
Loading in...5
×
 

Windows Azure Mobile Services

on

  • 756 views

Presentation from ConFoo 2014 on Windows Azure Mobile Services. Introducing the platform, building out an application that uses data storage, server-side scripts, custom API endpoints, push ...

Presentation from ConFoo 2014 on Windows Azure Mobile Services. Introducing the platform, building out an application that uses data storage, server-side scripts, custom API endpoints, push notifications, and client authentication. Source code is available on GitHub at http://github.com/goldshtn/rentahome

Statistics

Views

Total Views
756
Views on SlideShare
730
Embed Views
26

Actions

Likes
1
Downloads
7
Comments
0

3 Embeds 26

http://lanyrd.com 21
http://www.slideee.com 4
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Open the portal, show the general service settings and the dashboard that kind of gives you an app skeleton for free.Then, show the data tab with the tables we have, and basic data manipulation on these tables.Mention the concept of server scripts on CRUD operations – but don’t show these scripts yet.
  • Show the insert script on the apartments table.Explain that we’re using geocoding to obtain coordinates for the apartment, and we’re also pulling some information from Twitter (the user’s display name) – this will be explained later when we discuss authentication.
  • Show the channels table that contains the channels and the device types – this is necessary because the push semantics are different for each platform.Show the insert script on the apartments table again, and explain that it uses four different methods of the push module to deliver the push to the appropriate platform.
  • Demo the full app experience on all four platforms: login, add a new apartment, show push on other devices, delete an apartment, view maps (based on coordinates provided by the server).

Windows Azure Mobile Services Windows Azure Mobile Services Presentation Transcript

  • Sasha Goldshtein CTO, SELA Group @goldshtn blog.sashag.net Windows Azure Mobile Services © Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
  • Who Are We? App Developers What Do We Hate? Backends
  • We need one backend for all our mobile apps, scaled by the cloud Oh, and it should cost about $0-5 / month for a small, simple app
  • Backend as a Service Windows 8 & Windows Phone iOS & Android HTML & JavaScript Data & LINQ queries Server scripts, scheduler Authentication & WAADNEW Custom APINEW Source control and NPMNEW Push, notification hubsNEW
  • Windows Azure Mobile Services Portal Demo
  • Initializing The Mobile Service Client The application key is for development iOS Windows 8 / Windows PhoneIn Android use user purposes only. / production, authentication to limit access to data ms = new MobileServiceClient( [MSClient clientWithApplicationURLString: "https://rentahome.azure-mobile.net" "https://rentahome.azure-mobile.net", "..." /*API key*/); applicationKey:"..."];
  • Accessing Data // Windows 8 and Windows Phone var apartments = await ms.GetTable<Apartment>() .Where(a => a.Bedrooms > 2).ToListAsync(); // Android ms.getTable(Apartment.class).where(). .field("bedrooms").gt(2).execute(...); // iOS NSPredicate *pred = [NSPredicate predicateWithFormat:@"bedrooms > 2"]; [[client getTable:@"apartment"] readWhere:pred completion:^...];
  • Server Scripts CRUD operations can pass through a custom script Use for validation, data enrichment, etc. Scripts are written in JavaScript and run on Node.js Can access several Node modules: request, push, … function insert(item, user, request) { if (item.address.length === 0) { request.respond(400); } else { request.execute(); } }
  • Custom API Add custom HTTP endpoints to your mobile service Very useful for external access exports.post = function(request, response) { sharedHub.send_ad(request.body.message, function(error) { if (error) { response.send(500, 'Error sending ad: ' + error); } else { response.send(200); } }); };
  • Enriching Data with Server Scripts Demo
  • Push Prepare app for push from script On trigger, send push notifications Depends on platform Unfortunately, push API differs for each platform Channel = await PushNotificationChannelManager. push.wns.sendToast02(channel.uri, { text01: "New apartment added", CreatePushNotificationChannelForApplicationAsync(); channelsTable.Insert(new Channel(Channel.Uri)); text02: apartment.address });
  • Notification Hubs Register push messages based on the Blast out templates for push notifications with arbitrary and the tags template custom tags template = var payload{=data: { message: '$(message)' } }; { message : message }; hub.gcm.createTemplateRegistration(request.body.uri, }); hub.send(tag, payload, function(error, outcome) { ...tags, template, registrationComplete);
  • Server-Side Push Support Demo
  • Authentication // iOS if (!client.currentUser) { [self presentViewController:[client loginViewControllerWithProvider:@"twitter" completion:(MSUser *user, NSError *err) ... ] animated:YES]; } // Android if (client.getCurrentUser() != null) { client.login( MobileServiceAuthenticationProvider.Twitter, new UserAuthenticationCallback() ...); }
  • Authentication Demo
  • Summary Windows Azure Mobile Services provide a powerful and customizable backend for your mobile apps Code available at http://github.com/goldshtn/rentahome
  • Questions Sasha Goldshtein CTO, SELA Group @goldshtn blog.sashag.net