SlideShare a Scribd company logo
1 of 53
Thank you, sponsors!
What is Mobile Services?
Authentication out of the box
•
•

•
•

Microsoft Account
Twitter login
Google login
Facebook login
Developers.facebook.com
Setup facebook
Setup Mobile Services
Create Windows 8 project
Set table access level
Windows 8 sample application
Enable authenication
private MobileServiceUser user;
private async Task Authenticate()
{

user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook);
var message = string.Format("You are now logged in - {0}", user.UserId);
var dialog = new MessageDialog(message);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{

await Authenticate();
RefreshTodoItems();
}
See results on Windows 8 app
Enable authenication
private MobileServiceUser user;
private async Task Authenticate()
{

user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook);
var message = string.Format("You are now logged in - {0}", user.UserId);
var dialog = new MessageDialog(message);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{

await Authenticate();
RefreshTodoItems();
}
Authentication with groups on client
private FacebookSessionClient FacebookSessionClient = new FacebookSessionClient("1434104456805487");
private FacebookSession fbSession;
private MobileServiceUser user;
private async Task Authenticate()
{

fbSession = await FacebookSessionClient.LoginAsync("user_groups,user_likes,email");
var client = new FacebookClient(fbSession.AccessToken);
var token = JObject.FromObject(new { access_token = fbSession.AccessToken});
user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook, token);
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
await Authenticate();
RefreshTodoItems();

}
CRUD
•

Create
• Read
• Update
• Delete
Read operation
function read(query, user, request) {
request.execute();
}
Read operation with filtering

function read(query, user, request) {
var identities = user.getIdentities();
var req = require('request');
var fbAccessToken = identities.facebook.accessToken;
var url = 'https://graph.facebook.com/me?fields=groups.fields(id)&access_token=' + fbAccessToken;
req(url, function (err, resp, body) {
var userData = JSON.parse(body);
var groups = userData.groups.data;
for(var i=0;i<groups.length;i++){
if (groups[i].id == "304013539633881")
{
request.execute();
return;
}
}
query.take(2);
request.execute();
});
}
Major features of data handling
•

Dynamic schema
• Windows Azure SQL Database
Changing table model
public class TodoItem
{
public string Id { get; set; }
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }
[JsonProperty(PropertyName = "complete")]
public bool Complete { get; set; }
public string Platfrom { get; set; }
}
Changing handling logic
private async void UpdateCheckedTodoItem(TodoItem item)
{
if (item.Platfrom == null)
{
item.Platfrom = "Windows 8";
}
await todoTable.UpdateAsync(item);
items.Remove(item);
}
private void ButtonSave_Click(object sender, RoutedEventArgs e)
{
var todoItem = new TodoItem { Text = TextInput.Text, Platfrom = "Windows 8" };
InsertTodoItem(todoItem);
}
Data at portal
Data at SQL explorer
Notifications
•

Windows Phone
• Android
• iPhone
• Windows 8
Adding notifications to Windows 8
Visual Studio wizard
Reserve application name
Choose used mobile service
Notification is done!
App start and send channel to mobile service
2. Mobile service saves that into database and
sends notification
1.
Client implementation 2.0
public async static void UploadChannel(MobileServiceUser user)
{
var channel = await
PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
var token = HardwareIdentification.GetPackageSpecificToken(null);
string installationId = CryptographicBuffer.EncodeToBase64String(token.Id);
var ch = new Jobject
{
{"channelUri", channel.Uri},
{"installationId", installationId},
{"userId", user.UserId.Substring(9)}
};
await App.MobileService.GetTable("channels").InsertAsync(ch);
}
private MobileServiceUser user;
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
await Authenticate();
cloudbrewtapanila.cloudbrewtapanilaPush.UploadChannel(user);
RefreshTodoItems();
}
TodoItem Insert
function insert(item, user, request) {
var identities = user.getIdentities();
var fbUserId = identities.facebook.userId;
var ct = tables.getTable("channels");
ct.where({ userId: fbUserId }).read({
success: function (results) {
if (results.length > 0) {
sendNotifications(results[0].channelUri,item);
}
}
});
function sendNotifications(uri,todoItem) {
push.wns.sendToastText01(uri, { text1: "You have just inserted new todo " + todoItem.text },
{
success: function (pushResponse) {
console.log("Sent push:", pushResponse);
}
});
}
request.execute();
}
Enable from portal
Git repository
Clone your git repository
Folder structure
NPM install
Sendgrid
Sending email
var req = require('request');
var fbAccessToken = identities.facebook.accessToken;
var url = 'https://graph.facebook.com/me?fields=email&access_token=' + fbAccessToken;
req(url, function (err, resp, body) {
var userData = JSON.parse(body);
var userEmail = userData.email;
var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password");
sendgrid.send({
to: userEmail,
from: 'teemu@tapanila.net',
subject: ‘New todoitem added',
text: ‘You added new todoitem ‘ + todoItem.text
});
});
Creating scheduler job
BrewCloud
function BrewCloud() {
var td = tables.getTable("TodoItem");
td.where({ complete: false }).read({
success: function (results) {
if (results.length > 0) {
var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password");
sendgrid.send({
to: "teemu@tapanila.net",
from: 'teemu@tapanila.net',
subject: 'Status of brewing cloud',
text: 'There is ' + results.length + " items left“
});
}
}
});
}
Log on portal
Log on Visual Studio
What is Mobile Services?
The Cloud for
Modern Business

Grab your benefit

aka.ms/azuretry

Deploy fast in the
cloud, scale
elastically and
minimize test cost
Activate your Windows Azure MSDN
benefit at no additional charge

aka.ms/msdnsubs
cr

More Related Content

What's hot

The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210Mahmoud Samir Fayed
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivitiesmaamir farooq
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodepCloudy
 
Coded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculatorCoded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculatorOmer Karpas
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Processwacapps
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180Mahmoud Samir Fayed
 
Vb database connections
Vb database connectionsVb database connections
Vb database connectionsTharsikan
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAravindharamanan S
 

What's hot (9)

The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.9 book - Part 82 of 210
 
Leture5 exercise onactivities
Leture5 exercise onactivitiesLeture5 exercise onactivities
Leture5 exercise onactivities
 
XCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with XcodeXCUITest for iOS App Testing and how to test with Xcode
XCUITest for iOS App Testing and how to test with Xcode
 
Coded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculatorCoded ui - lesson 3 - case study - calculator
Coded ui - lesson 3 - case study - calculator
 
WAC Widget Upload Process
WAC Widget Upload ProcessWAC Widget Upload Process
WAC Widget Upload Process
 
Test script
Test scriptTest script
Test script
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180
 
Vb database connections
Vb database connectionsVb database connections
Vb database connections
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codes
 

Viewers also liked

Tuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheterTuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheterGlenn Colpaert
 
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)Codit
 
Azure Resource Manager Templates
Azure Resource Manager TemplatesAzure Resource Manager Templates
Azure Resource Manager TemplatesBenjamin Hüpeden
 
SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud delaware BeLux
 
SAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and BenefitsSAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and BenefitsmyCloudDoor
 
Leverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud MigrationLeverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud MigrationCapgemini
 
What is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAPWhat is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAPGlobustrainings
 
SAP INTRO
SAP INTROSAP INTRO
SAP INTRODr.Ravi
 

Viewers also liked (11)

Tuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheterTuga - SAP and Azure, Better togheter
Tuga - SAP and Azure, Better togheter
 
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
SAP and Azure better together (Glenn Colpaert @TUGA IT 2016)
 
Azure Resource Manager Templates
Azure Resource Manager TemplatesAzure Resource Manager Templates
Azure Resource Manager Templates
 
Migrating sap wft_case_study_final (1)
Migrating sap wft_case_study_final (1)Migrating sap wft_case_study_final (1)
Migrating sap wft_case_study_final (1)
 
SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud SAP powered by Microsoft Azure: A match made in the cloud
SAP powered by Microsoft Azure: A match made in the cloud
 
SAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and BenefitsSAP on Azure. Use Cases and Benefits
SAP on Azure. Use Cases and Benefits
 
Leverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud MigrationLeverage the Power of SAP HANA with Microsoft Azure Cloud Migration
Leverage the Power of SAP HANA with Microsoft Azure Cloud Migration
 
SAP Basics
SAP BasicsSAP Basics
SAP Basics
 
What is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAPWhat is SAP| SAP Introduction | Overview of SAP
What is SAP| SAP Introduction | Overview of SAP
 
SAP INTRO
SAP INTROSAP INTRO
SAP INTRO
 
SAP for Beginners
SAP for BeginnersSAP for Beginners
SAP for Beginners
 

Similar to CloudBrew: Windows Azure Mobile Services - Next stage

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Wes Yanaga
 
AI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedAI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedMarvin Heng
 
Mobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows PhoneMobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows PhoneEdgewater
 
Creating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfCreating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfShaiAlmog1
 
Xamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected appsXamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected appsAlexandre Marreiros
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
 
Windows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceWindows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceTechWell
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesSasha Goldshtein
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
WinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test AutomationWinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test AutomationJeremy Kao
 
Cómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoCómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoGemma Del Olmo
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfShaiAlmog1
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발영욱 김
 
SRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile ServicesSRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile ServicesAmazon Web Services
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 seriesopenbala
 

Similar to CloudBrew: Windows Azure Mobile Services - Next stage (20)

GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2
 
AI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedAI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You Typed
 
Mobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows PhoneMobile for SharePoint with Windows Phone
Mobile for SharePoint with Windows Phone
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
Creating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfCreating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdf
 
Android+ax+app+wcf
Android+ax+app+wcfAndroid+ax+app+wcf
Android+ax+app+wcf
 
Xamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected appsXamarin devdays 2017 - PT - connected apps
Xamarin devdays 2017 - PT - connected apps
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Android ax app wcf
Android ax app wcfAndroid ax app wcf
Android ax app wcf
 
Windows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceWindows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile Workforce
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
 
WinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test AutomationWinAppDriver - Windows Store Apps Test Automation
WinAppDriver - Windows Store Apps Test Automation
 
Cómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte locoCómo tener analíticas en tu app y no volverte loco
Cómo tener analíticas en tu app y no volverte loco
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발
 
Bot builder v4 HOL
Bot builder v4 HOLBot builder v4 HOL
Bot builder v4 HOL
 
SRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile ServicesSRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile Services
 
Windows phone 7 series
Windows phone 7 seriesWindows phone 7 series
Windows phone 7 series
 

More from Teemu Tapanila

Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019Teemu Tapanila
 
Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...Teemu Tapanila
 
Building analytics with event grid
Building analytics with event gridBuilding analytics with event grid
Building analytics with event gridTeemu Tapanila
 
CloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service FabricCloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service FabricTeemu Tapanila
 
TechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTeemu Tapanila
 
AppCampus Overview 19.9
AppCampus Overview 19.9AppCampus Overview 19.9
AppCampus Overview 19.9Teemu Tapanila
 

More from Teemu Tapanila (7)

Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019Connecting your IoT devices to azure - Techorama 2019
Connecting your IoT devices to azure - Techorama 2019
 
Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...Deploy with confidence and speed to Microsoft azure using visual studio team ...
Deploy with confidence and speed to Microsoft azure using visual studio team ...
 
Building analytics with event grid
Building analytics with event gridBuilding analytics with event grid
Building analytics with event grid
 
CloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service FabricCloudBrew 2016 - Building IoT solution with Service Fabric
CloudBrew 2016 - Building IoT solution with Service Fabric
 
TechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile servicesTechDays 2013: Creating backend with windows azure mobile services
TechDays 2013: Creating backend with windows azure mobile services
 
AppCampus Overview 19.9
AppCampus Overview 19.9AppCampus Overview 19.9
AppCampus Overview 19.9
 
AppCampus overview
AppCampus overviewAppCampus overview
AppCampus overview
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

CloudBrew: Windows Azure Mobile Services - Next stage

  • 1.
  • 3. What is Mobile Services?
  • 4.
  • 5. Authentication out of the box • • • • Microsoft Account Twitter login Google login Facebook login
  • 11. Windows 8 sample application
  • 12. Enable authenication private MobileServiceUser user; private async Task Authenticate() { user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook); var message = string.Format("You are now logged in - {0}", user.UserId); var dialog = new MessageDialog(message); dialog.Commands.Add(new UICommand("OK")); await dialog.ShowAsync(); } protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); RefreshTodoItems(); }
  • 13. See results on Windows 8 app
  • 14.
  • 15. Enable authenication private MobileServiceUser user; private async Task Authenticate() { user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook); var message = string.Format("You are now logged in - {0}", user.UserId); var dialog = new MessageDialog(message); dialog.Commands.Add(new UICommand("OK")); await dialog.ShowAsync(); } protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); RefreshTodoItems(); }
  • 16. Authentication with groups on client private FacebookSessionClient FacebookSessionClient = new FacebookSessionClient("1434104456805487"); private FacebookSession fbSession; private MobileServiceUser user; private async Task Authenticate() { fbSession = await FacebookSessionClient.LoginAsync("user_groups,user_likes,email"); var client = new FacebookClient(fbSession.AccessToken); var token = JObject.FromObject(new { access_token = fbSession.AccessToken}); user = await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook, token); } protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); RefreshTodoItems(); }
  • 17.
  • 19. Read operation function read(query, user, request) { request.execute(); }
  • 20. Read operation with filtering function read(query, user, request) { var identities = user.getIdentities(); var req = require('request'); var fbAccessToken = identities.facebook.accessToken; var url = 'https://graph.facebook.com/me?fields=groups.fields(id)&access_token=' + fbAccessToken; req(url, function (err, resp, body) { var userData = JSON.parse(body); var groups = userData.groups.data; for(var i=0;i<groups.length;i++){ if (groups[i].id == "304013539633881") { request.execute(); return; } } query.take(2); request.execute(); }); }
  • 21.
  • 22. Major features of data handling • Dynamic schema • Windows Azure SQL Database
  • 23. Changing table model public class TodoItem { public string Id { get; set; } [JsonProperty(PropertyName = "text")] public string Text { get; set; } [JsonProperty(PropertyName = "complete")] public bool Complete { get; set; } public string Platfrom { get; set; } }
  • 24. Changing handling logic private async void UpdateCheckedTodoItem(TodoItem item) { if (item.Platfrom == null) { item.Platfrom = "Windows 8"; } await todoTable.UpdateAsync(item); items.Remove(item); } private void ButtonSave_Click(object sender, RoutedEventArgs e) { var todoItem = new TodoItem { Text = TextInput.Text, Platfrom = "Windows 8" }; InsertTodoItem(todoItem); }
  • 26. Data at SQL explorer
  • 27.
  • 33. Notification is done! App start and send channel to mobile service 2. Mobile service saves that into database and sends notification 1.
  • 34. Client implementation 2.0 public async static void UploadChannel(MobileServiceUser user) { var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); var token = HardwareIdentification.GetPackageSpecificToken(null); string installationId = CryptographicBuffer.EncodeToBase64String(token.Id); var ch = new Jobject { {"channelUri", channel.Uri}, {"installationId", installationId}, {"userId", user.UserId.Substring(9)} }; await App.MobileService.GetTable("channels").InsertAsync(ch); } private MobileServiceUser user; protected override async void OnNavigatedTo(NavigationEventArgs e) { await Authenticate(); cloudbrewtapanila.cloudbrewtapanilaPush.UploadChannel(user); RefreshTodoItems(); }
  • 35. TodoItem Insert function insert(item, user, request) { var identities = user.getIdentities(); var fbUserId = identities.facebook.userId; var ct = tables.getTable("channels"); ct.where({ userId: fbUserId }).read({ success: function (results) { if (results.length > 0) { sendNotifications(results[0].channelUri,item); } } }); function sendNotifications(uri,todoItem) { push.wns.sendToastText01(uri, { text1: "You have just inserted new todo " + todoItem.text }, { success: function (pushResponse) { console.log("Sent push:", pushResponse); } }); } request.execute(); }
  • 36.
  • 39. Clone your git repository
  • 43. Sending email var req = require('request'); var fbAccessToken = identities.facebook.accessToken; var url = 'https://graph.facebook.com/me?fields=email&access_token=' + fbAccessToken; req(url, function (err, resp, body) { var userData = JSON.parse(body); var userEmail = userData.email; var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password"); sendgrid.send({ to: userEmail, from: 'teemu@tapanila.net', subject: ‘New todoitem added', text: ‘You added new todoitem ‘ + todoItem.text }); });
  • 44.
  • 46. BrewCloud function BrewCloud() { var td = tables.getTable("TodoItem"); td.where({ complete: false }).read({ success: function (results) { if (results.length > 0) { var sendgrid = require('sendgrid')("TapanilaCloudBrew", "password"); sendgrid.send({ to: "teemu@tapanila.net", from: 'teemu@tapanila.net', subject: 'Status of brewing cloud', text: 'There is ' + results.length + " items left“ }); } } }); }
  • 47.
  • 49. Log on Visual Studio
  • 50.
  • 51. What is Mobile Services?
  • 52.
  • 53. The Cloud for Modern Business Grab your benefit aka.ms/azuretry Deploy fast in the cloud, scale elastically and minimize test cost Activate your Windows Azure MSDN benefit at no additional charge aka.ms/msdnsubs cr