SlideShare una empresa de Scribd logo
1 de 38
Building a cross-platform chat app
with Microsoft Azure Mobile
Services
14 may 2014, Timisoara
Timisoara .Net Meetup #1
Flavius Radu Demian
Software developer, Avaelgo
I really like programming, especially web and mobile
Please feel free to ask questions any time and don’t be shy
Knowledge is power 
flaviusdemian91@yahoo.com | flavius.demian@gmail.com | @slowarad
Expectations
Learn how to use mobile services
Learn when to use mobile services
Learn the strengths and limitations of mobile services
Learn that mobile services wants to be friend with everyone
Make you curious  => go home and play with it
Agenda
Overview
Storage
Custom API
Authentication & Authorization
Scheduler
Agenda
Diagnostics & Logging
Scale
Cool Third Party Add-Ons
Design of the chat app
Review
A visual representation
Overview
Mobile Services allows you to accelerate your mobile app
development by providing a turnkey way to structure storage,
authenticate users, and send push notifications.
With SDKs for Windows, Android, iOS, and HTML as well as a
powerful and flexible REST API, Mobile Services lets you to
build connected applications for any platform and deliver a
consistent experience across devices.
Overview
Clients for:
Windows Store, Windows Phone 8, iOS, Android, Javascript
You can add a cloud backend to your app in minutes without
the need for server code
The backend login can be written in node.js or c# (preview)
The SDK’s are open source (on github) , it’s integrated with GIT
Overview
Easily build a backend for mobile apps and not only
Easily manipulate data (filters)
Easily authenticate users
Send push notifications
Integrate your favorite services and great community
Server side logic
Node.js
Is a software platform for scalable server-side and networking
applications
Applications are written in JavaScript can be run within the
Node.js runtime on Windows, Mac OS X and Linux with no
changes
It is written in
Storage
Windows Azure SQL Database
Dynamic schema on/off
REST API generated per table -> Data centric platform
Access your data through :
Portal, SQL Management Studio, Rest API
Storage
JSON to SQL data types conversions
“Data Centric” Server Logic
Backend runs Node JS on small azure VM’s
“Interceptors” exposed for all CRUD requests to all tables
You get access to a predefined set of node modules :
request, console, push.*, tables, statusCodes, azure, mssql
Custom API
You can write your own API very easily and quickly
If you need you can add extra Node JS packages
exports.get = function(req, res) { /* code here */ }
exports.post = function(req, res) {/* code here */ }
Small demo time part 1
Login in the portal and create a mobile service
Set GIT credentials and get repository
Create some tables, show interceptors
Create a custom API
See list of predefined packages -> click here
Push notifications
The notification provider server maintains a "persistent IP
connection" with your device in order to deliver notifications
when the app needs to 'say' something to you.
Payload limited, specific to platform
The global push object is used to send push notifications
Success and Error callbacks are provided
Push notifications
Platform specific providers:
Push notifications overview
1) The app requests a channel from the
Notifications Provider
2) The app sends the channel url to
Mobile Services which stores it
3) When a notification is sent, Mobile
Services executes something like this:
push.mpns.send(channelUri….)
Windows Phone case study
4) The notification goes through the Notifications Provider which forwards it to the device
Authentication & Authorization
You can make provide quick auth in your app with
Facebook Twitter Google Microsoft
and Windows Azure Active Directory
Authorization
Table level authorization for CRUD operation
Everyone -> any request by anyone is accepted
Anyone with Application Key -> app key is sent on the request
distributed (default)
Authenticated Users -> users authenticated with one of the
mentioned identity providers
Authorization
Table level authorization for CRUD operation (*cont)
Scripts and Admins -> registers scripts or requests via the
master key
The application key is not secure and should not be used to
authenticate users of your app, especially in production
Scheduler
It runs jobs on simple or complex recurring schedules such as:
1) Send broadcast push notifications
2) Processing or resizing stored images
3) Invoking a Web Service over HTTP/s
4) Post a message to a Windows Azure Storage Queue, etc
Diagnostics and Logging
View diagnostics directly in the portal including :
1) API calls
2) CPU time
3) Data Out
LoggingConsole.* operations like console.log and console.error
provide an easy means to debug your server side scripts.
Scale
Compute - scale between shared and reserved mode
Increase/decrease your instance count
Storage ability to scale out your mobile service tenant(s) to a
dedicated SQL DB
Ability to scale up your SQL DB from web through business to
150GB. Since Microsoft Build it is up to 500GB .
Small demo time part 2
Push notifications
Authentication
Authorization
Diagnostics
Logging
Scale
Code cheat sheet - client
public MobileServiceClient MobileService = new MobileServiceClient(“dns”,“key");
public IMobileServiceTable<UserEntity> Users = App.MobileService.GetTable<UserEntity>();
public MobileServiceUser MobileServicesUser = await App.MobileService.LoginAsync(provider);
await UsersTable.InsertAsync(App.CurrentUser);
result = await App.MobileService.InvokeApiAsync<T>(“link”, HttpMethod.Get, extraParams);
App.MobileService.Logout();
Code cheat sheet – server (interceptor)
function insert(item, user, request) {
console.log("item is: " + JSON.stringify(item));
var sql = "SELECT name FROM UserEntity WHERE providerIdLong = ? AND identityProvider = ?";
mssql.query(sql, [item.providerIdLong, item.identityProvider], {
success: function(results) {
if( results.length == 0){
results = null;
}
completeUserProfile(item, user, request, results);
},
error: function(err) {
request.respond(statusCodes.BAD_REQUEST, { message: err });
}
});
}
Code cheat sheet – server (Api)
exports.get = function(req, res) {
var userTable = req.service.tables.getTable('userEntity');
var userToExclude = req.query.userId;
userTable.read({
success: function (items) {
if (items.length > 0) {
var finalResults = [], currentEntry = null;
items.forEach(function(item) {
if( item.providerIdLong != userToExclude){
currentEntry = new Object(); currentEntry.name = item.name;
finalResults.push(currentEntry);
}
});
res.send(statusCodes.OK, finalResults);
} }
}); };
Code cheat sheet – server (push)
if (entry.deviceType === "Android") //Android
{
var payload = new Object();
payload.content = item.content;
payload.fromId = item.fromId;
payload.fromPicture = item.fromPicture;
payload.fromName = item.fromName;
push.gcm.send(entry.registrationId, JSON.stringify(payload), {
success: function(response) {
console.log('Android Push notification sent: ', response);
}, error: function(error) {
console.log('Android Error sending push notification android: ', error);
}
});
}
Cool Third Party Add-Ons
Real time communication Emails SMS
Let’s talk about the chat app
Design - Functionalities
Integrate Microsoft Azure Mobile Services
Integrate with social media providers
Store data to cloud after auth ( user and channel related data )
Retrieve the rest of the users you can talk to (custom API)
Send message functionality
Receive message functionality
Logout functionality
Design – send push to web
Design - Database
Tables: users, channels, messages
Channel
ChannelUri
RegistrationId
UserProviderId
DeviceType
Message
FromId
ToId
DeviceType
FromName
FromPicture
User
ProviderId
Name
Picture
AccessToken
AccessTokenSecret
Let’s show some code
But first let’s see a short teaser
Review of Azure Mobile Services
Create a scalable and secure backend for your Windows, Android
and iOS apps
Store data in the cloud
Easily authenticate users
Send push notifications
Review of Azure Mobile Services
Consume your favorite services
Monitor, alert, and auto scale
Cheap and FREE in some cases -> click here
Preview: No availability Service Level Agreement
Paid: General Availability: 99.9%
Thanks
Any questions?

Más contenido relacionado

La actualidad más candente

20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나
20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나
20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나영욱 김
 
Rhinos have tea_on_azure
Rhinos have tea_on_azureRhinos have tea_on_azure
Rhinos have tea_on_azureCEDRIC DERUE
 
Migrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows AzureMigrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows AzureEric Shupps
 
Yelowsoft Features paper
Yelowsoft Features paperYelowsoft Features paper
Yelowsoft Features paperYelowsoft
 
Building On Demand Apps On Force.com
Building On Demand Apps On Force.comBuilding On Demand Apps On Force.com
Building On Demand Apps On Force.comguneetsahai
 
Aws meetup systems_manager
Aws meetup systems_managerAws meetup systems_manager
Aws meetup systems_managerAdam Book
 
Web Application Architecture: Everything You Need to Know About
Web Application Architecture: Everything You Need to Know AboutWeb Application Architecture: Everything You Need to Know About
Web Application Architecture: Everything You Need to Know AboutNoman Shaikh
 
Google App Engine - Overview #1
Google App Engine - Overview #1Google App Engine - Overview #1
Google App Engine - Overview #1Kay Kim
 
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...NCCOMMS
 
Build 2017 - B8099 - What's new in Xamarin.Forms
Build 2017 - B8099 - What's new in Xamarin.FormsBuild 2017 - B8099 - What's new in Xamarin.Forms
Build 2017 - B8099 - What's new in Xamarin.FormsWindows Developer
 
Windows 8 programming with html and java script
Windows 8 programming with html and java scriptWindows 8 programming with html and java script
Windows 8 programming with html and java scriptRTigger
 
Revised Adf security in a project centric environment
Revised Adf security in a project centric environmentRevised Adf security in a project centric environment
Revised Adf security in a project centric environmentJean-Marc Desvaux
 
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
 How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi... How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...Aimore Technologies
 
Securing SharePoint Apps with OAuth
Securing SharePoint Apps with OAuthSecuring SharePoint Apps with OAuth
Securing SharePoint Apps with OAuthKashif Imran
 
Android sync adapter
Android sync adapterAndroid sync adapter
Android sync adapterAlex Tumanoff
 
Introduction to Azure Web Applications
Introduction to Azure Web ApplicationsIntroduction to Azure Web Applications
Introduction to Azure Web ApplicationsJoAnna Cheshire
 
Brewing Beer with Windows Azure
Brewing Beer with Windows AzureBrewing Beer with Windows Azure
Brewing Beer with Windows AzureMaarten Balliauw
 

La actualidad más candente (19)

20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나
20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나
20140424 Android / iOS 개발자를 위한 Microsoft BaaS 세미나
 
Rhinos have tea_on_azure
Rhinos have tea_on_azureRhinos have tea_on_azure
Rhinos have tea_on_azure
 
Migrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows AzureMigrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
Migrating Legacy On-Premise Applications to SharePoint Online and Windows Azure
 
Yelowsoft Features paper
Yelowsoft Features paperYelowsoft Features paper
Yelowsoft Features paper
 
Building On Demand Apps On Force.com
Building On Demand Apps On Force.comBuilding On Demand Apps On Force.com
Building On Demand Apps On Force.com
 
Aws meetup systems_manager
Aws meetup systems_managerAws meetup systems_manager
Aws meetup systems_manager
 
IBM Single Sign-On
IBM Single Sign-OnIBM Single Sign-On
IBM Single Sign-On
 
Web Application Architecture: Everything You Need to Know About
Web Application Architecture: Everything You Need to Know AboutWeb Application Architecture: Everything You Need to Know About
Web Application Architecture: Everything You Need to Know About
 
Vaadin NYC Meetup
Vaadin NYC MeetupVaadin NYC Meetup
Vaadin NYC Meetup
 
Google App Engine - Overview #1
Google App Engine - Overview #1Google App Engine - Overview #1
Google App Engine - Overview #1
 
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...
O365Con18 - Connect SharePoint Framework Solutions to API's secured with Azur...
 
Build 2017 - B8099 - What's new in Xamarin.Forms
Build 2017 - B8099 - What's new in Xamarin.FormsBuild 2017 - B8099 - What's new in Xamarin.Forms
Build 2017 - B8099 - What's new in Xamarin.Forms
 
Windows 8 programming with html and java script
Windows 8 programming with html and java scriptWindows 8 programming with html and java script
Windows 8 programming with html and java script
 
Revised Adf security in a project centric environment
Revised Adf security in a project centric environmentRevised Adf security in a project centric environment
Revised Adf security in a project centric environment
 
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
 How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi... How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
How DotNet, SharePoint, and Azure helps to build a Custom Web Application wi...
 
Securing SharePoint Apps with OAuth
Securing SharePoint Apps with OAuthSecuring SharePoint Apps with OAuth
Securing SharePoint Apps with OAuth
 
Android sync adapter
Android sync adapterAndroid sync adapter
Android sync adapter
 
Introduction to Azure Web Applications
Introduction to Azure Web ApplicationsIntroduction to Azure Web Applications
Introduction to Azure Web Applications
 
Brewing Beer with Windows Azure
Brewing Beer with Windows AzureBrewing Beer with Windows Azure
Brewing Beer with Windows Azure
 

Similar a Building a chat app with windows azure mobile

Azure Mobile Services for Cross Platform Mobile Apps
Azure Mobile Services for Cross Platform Mobile AppsAzure Mobile Services for Cross Platform Mobile Apps
Azure Mobile Services for Cross Platform Mobile AppsWinWire Technologies Inc
 
Cloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with AzureCloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with AzureKen Cenerelli
 
Windows azure mobile services from start to rest
Windows azure mobile services from start to restWindows azure mobile services from start to rest
Windows azure mobile services from start to restAidan Casey
 
Windows azure mobile services and windows phone 8
Windows azure mobile services and windows phone 8Windows azure mobile services and windows phone 8
Windows azure mobile services and windows phone 8Karthikeyan Anbarasan (AK)
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Lou Sacco
 
Microsoft graph and power platform champ
Microsoft graph and power platform   champMicrosoft graph and power platform   champ
Microsoft graph and power platform champKumton Suttiraksiri
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Kashif Imran
 
Pune microsoft azure developers 2nd meetup
Pune microsoft azure developers 2nd meetupPune microsoft azure developers 2nd meetup
Pune microsoft azure developers 2nd meetupratneshsinghparihar
 
Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...
Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...
Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...MUG-Lyon Microsoft User Group
 
CTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricCTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricSpiffy
 
Windows Azure for .NET Developers
Windows Azure for .NET DevelopersWindows Azure for .NET Developers
Windows Azure for .NET Developersllangit
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...MSDEVMTL
 
Cloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps  with AzureCloud Powered Mobile Apps  with Azure
Cloud Powered Mobile Apps with AzureKris Wagner
 
2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile ServicesMarco Parenzan
 
Cnam cours azure zecloud mobile services
Cnam cours azure zecloud mobile servicesCnam cours azure zecloud mobile services
Cnam cours azure zecloud mobile servicesAymeric Weinbach
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesSasha Goldshtein
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Osconvijayrvr
 
Azure Mobile Services Workshop
Azure Mobile Services WorkshopAzure Mobile Services Workshop
Azure Mobile Services WorkshopEran Stiller
 

Similar a Building a chat app with windows azure mobile (20)

Azure Mobile Services for Cross Platform Mobile Apps
Azure Mobile Services for Cross Platform Mobile AppsAzure Mobile Services for Cross Platform Mobile Apps
Azure Mobile Services for Cross Platform Mobile Apps
 
Cloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with AzureCloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps with Azure
 
Windows azure mobile services from start to rest
Windows azure mobile services from start to restWindows azure mobile services from start to rest
Windows azure mobile services from start to rest
 
Windows azure mobile services and windows phone 8
Windows azure mobile services and windows phone 8Windows azure mobile services and windows phone 8
Windows azure mobile services and windows phone 8
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
 
Microsoft graph and power platform champ
Microsoft graph and power platform   champMicrosoft graph and power platform   champ
Microsoft graph and power platform champ
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
 
Pune microsoft azure developers 2nd meetup
Pune microsoft azure developers 2nd meetupPune microsoft azure developers 2nd meetup
Pune microsoft azure developers 2nd meetup
 
Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...
Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...
Global Windows Azure Bootcamp : Cedric Derue Rhinos have tea on azure. (spons...
 
CTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App FabricCTU June 2011 - Windows Azure App Fabric
CTU June 2011 - Windows Azure App Fabric
 
Windows Azure for .NET Developers
Windows Azure for .NET DevelopersWindows Azure for .NET Developers
Windows Azure for .NET Developers
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
 
Cloud Powered Mobile Apps with Azure
Cloud Powered Mobile Apps  with AzureCloud Powered Mobile Apps  with Azure
Cloud Powered Mobile Apps with Azure
 
2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services
 
Cnam cours azure zecloud mobile services
Cnam cours azure zecloud mobile servicesCnam cours azure zecloud mobile services
Cnam cours azure zecloud mobile services
 
Karthikeyan_Resume
Karthikeyan_ResumeKarthikeyan_Resume
Karthikeyan_Resume
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
Vijay Oscon
Vijay OsconVijay Oscon
Vijay Oscon
 
Azure Mobile Services Workshop
Azure Mobile Services WorkshopAzure Mobile Services Workshop
Azure Mobile Services Workshop
 
Pragatheswarakumar_v1.0
Pragatheswarakumar_v1.0Pragatheswarakumar_v1.0
Pragatheswarakumar_v1.0
 

Más de Flavius-Radu Demian

C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossFlavius-Radu Demian
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossFlavius-Radu Demian
 
ALM on the shoulders of Giants - Visual Studio Online
ALM on the shoulders of Giants - Visual Studio OnlineALM on the shoulders of Giants - Visual Studio Online
ALM on the shoulders of Giants - Visual Studio OnlineFlavius-Radu Demian
 

Más de Flavius-Radu Demian (8)

Mobile growth with Xamarin
Mobile growth with XamarinMobile growth with Xamarin
Mobile growth with Xamarin
 
MVVM frameworks - MvvmCross
MVVM frameworks - MvvmCrossMVVM frameworks - MvvmCross
MVVM frameworks - MvvmCross
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
 
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCrossC# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
C# everywhere - Building Cross-Platform Apps with Xamarin and MvvmCross
 
ALM on the shoulders of Giants - Visual Studio Online
ALM on the shoulders of Giants - Visual Studio OnlineALM on the shoulders of Giants - Visual Studio Online
ALM on the shoulders of Giants - Visual Studio Online
 
Universal apps
Universal appsUniversal apps
Universal apps
 
Security in windows azure
Security in windows azureSecurity in windows azure
Security in windows azure
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Último (20)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Building a chat app with windows azure mobile

  • 1. Building a cross-platform chat app with Microsoft Azure Mobile Services 14 may 2014, Timisoara Timisoara .Net Meetup #1
  • 2. Flavius Radu Demian Software developer, Avaelgo I really like programming, especially web and mobile Please feel free to ask questions any time and don’t be shy Knowledge is power  flaviusdemian91@yahoo.com | flavius.demian@gmail.com | @slowarad
  • 3. Expectations Learn how to use mobile services Learn when to use mobile services Learn the strengths and limitations of mobile services Learn that mobile services wants to be friend with everyone Make you curious  => go home and play with it
  • 5. Agenda Diagnostics & Logging Scale Cool Third Party Add-Ons Design of the chat app Review
  • 7. Overview Mobile Services allows you to accelerate your mobile app development by providing a turnkey way to structure storage, authenticate users, and send push notifications. With SDKs for Windows, Android, iOS, and HTML as well as a powerful and flexible REST API, Mobile Services lets you to build connected applications for any platform and deliver a consistent experience across devices.
  • 8. Overview Clients for: Windows Store, Windows Phone 8, iOS, Android, Javascript You can add a cloud backend to your app in minutes without the need for server code The backend login can be written in node.js or c# (preview) The SDK’s are open source (on github) , it’s integrated with GIT
  • 9. Overview Easily build a backend for mobile apps and not only Easily manipulate data (filters) Easily authenticate users Send push notifications Integrate your favorite services and great community
  • 10. Server side logic Node.js Is a software platform for scalable server-side and networking applications Applications are written in JavaScript can be run within the Node.js runtime on Windows, Mac OS X and Linux with no changes It is written in
  • 11. Storage Windows Azure SQL Database Dynamic schema on/off REST API generated per table -> Data centric platform Access your data through : Portal, SQL Management Studio, Rest API
  • 12. Storage JSON to SQL data types conversions
  • 13. “Data Centric” Server Logic Backend runs Node JS on small azure VM’s “Interceptors” exposed for all CRUD requests to all tables You get access to a predefined set of node modules : request, console, push.*, tables, statusCodes, azure, mssql
  • 14. Custom API You can write your own API very easily and quickly If you need you can add extra Node JS packages exports.get = function(req, res) { /* code here */ } exports.post = function(req, res) {/* code here */ }
  • 15. Small demo time part 1 Login in the portal and create a mobile service Set GIT credentials and get repository Create some tables, show interceptors Create a custom API See list of predefined packages -> click here
  • 16. Push notifications The notification provider server maintains a "persistent IP connection" with your device in order to deliver notifications when the app needs to 'say' something to you. Payload limited, specific to platform The global push object is used to send push notifications Success and Error callbacks are provided
  • 18. Push notifications overview 1) The app requests a channel from the Notifications Provider 2) The app sends the channel url to Mobile Services which stores it 3) When a notification is sent, Mobile Services executes something like this: push.mpns.send(channelUri….) Windows Phone case study 4) The notification goes through the Notifications Provider which forwards it to the device
  • 19. Authentication & Authorization You can make provide quick auth in your app with Facebook Twitter Google Microsoft and Windows Azure Active Directory
  • 20. Authorization Table level authorization for CRUD operation Everyone -> any request by anyone is accepted Anyone with Application Key -> app key is sent on the request distributed (default) Authenticated Users -> users authenticated with one of the mentioned identity providers
  • 21. Authorization Table level authorization for CRUD operation (*cont) Scripts and Admins -> registers scripts or requests via the master key The application key is not secure and should not be used to authenticate users of your app, especially in production
  • 22. Scheduler It runs jobs on simple or complex recurring schedules such as: 1) Send broadcast push notifications 2) Processing or resizing stored images 3) Invoking a Web Service over HTTP/s 4) Post a message to a Windows Azure Storage Queue, etc
  • 23. Diagnostics and Logging View diagnostics directly in the portal including : 1) API calls 2) CPU time 3) Data Out LoggingConsole.* operations like console.log and console.error provide an easy means to debug your server side scripts.
  • 24. Scale Compute - scale between shared and reserved mode Increase/decrease your instance count Storage ability to scale out your mobile service tenant(s) to a dedicated SQL DB Ability to scale up your SQL DB from web through business to 150GB. Since Microsoft Build it is up to 500GB .
  • 25. Small demo time part 2 Push notifications Authentication Authorization Diagnostics Logging Scale
  • 26. Code cheat sheet - client public MobileServiceClient MobileService = new MobileServiceClient(“dns”,“key"); public IMobileServiceTable<UserEntity> Users = App.MobileService.GetTable<UserEntity>(); public MobileServiceUser MobileServicesUser = await App.MobileService.LoginAsync(provider); await UsersTable.InsertAsync(App.CurrentUser); result = await App.MobileService.InvokeApiAsync<T>(“link”, HttpMethod.Get, extraParams); App.MobileService.Logout();
  • 27. Code cheat sheet – server (interceptor) function insert(item, user, request) { console.log("item is: " + JSON.stringify(item)); var sql = "SELECT name FROM UserEntity WHERE providerIdLong = ? AND identityProvider = ?"; mssql.query(sql, [item.providerIdLong, item.identityProvider], { success: function(results) { if( results.length == 0){ results = null; } completeUserProfile(item, user, request, results); }, error: function(err) { request.respond(statusCodes.BAD_REQUEST, { message: err }); } }); }
  • 28. Code cheat sheet – server (Api) exports.get = function(req, res) { var userTable = req.service.tables.getTable('userEntity'); var userToExclude = req.query.userId; userTable.read({ success: function (items) { if (items.length > 0) { var finalResults = [], currentEntry = null; items.forEach(function(item) { if( item.providerIdLong != userToExclude){ currentEntry = new Object(); currentEntry.name = item.name; finalResults.push(currentEntry); } }); res.send(statusCodes.OK, finalResults); } } }); };
  • 29. Code cheat sheet – server (push) if (entry.deviceType === "Android") //Android { var payload = new Object(); payload.content = item.content; payload.fromId = item.fromId; payload.fromPicture = item.fromPicture; payload.fromName = item.fromName; push.gcm.send(entry.registrationId, JSON.stringify(payload), { success: function(response) { console.log('Android Push notification sent: ', response); }, error: function(error) { console.log('Android Error sending push notification android: ', error); } }); }
  • 30. Cool Third Party Add-Ons Real time communication Emails SMS
  • 31. Let’s talk about the chat app
  • 32. Design - Functionalities Integrate Microsoft Azure Mobile Services Integrate with social media providers Store data to cloud after auth ( user and channel related data ) Retrieve the rest of the users you can talk to (custom API) Send message functionality Receive message functionality Logout functionality
  • 33. Design – send push to web
  • 34. Design - Database Tables: users, channels, messages Channel ChannelUri RegistrationId UserProviderId DeviceType Message FromId ToId DeviceType FromName FromPicture User ProviderId Name Picture AccessToken AccessTokenSecret
  • 35. Let’s show some code But first let’s see a short teaser
  • 36. Review of Azure Mobile Services Create a scalable and secure backend for your Windows, Android and iOS apps Store data in the cloud Easily authenticate users Send push notifications
  • 37. Review of Azure Mobile Services Consume your favorite services Monitor, alert, and auto scale Cheap and FREE in some cases -> click here Preview: No availability Service Level Agreement Paid: General Availability: 99.9%