SlideShare a Scribd company logo
YOUR APP. OUR CLOUD.
THE PROBLEM
2
Vast amounts of time and money is
spent
building a backend infrastructure
The mobile developers business
is mobile development
1 Have an idea
2 Define a backend
infrastructure
Pick a hosting provider
3 Develop your backend
software
Test the infrastructure
4 Build your mobile application
5 Maintain your infrastructure
WHAT IS CLOUDBASE.IO
3
cloudbase.io is the entire
backend stack of your
mobile application
Leaving you free to do
what you do best…
Build mobile applications
 CloudBase
Online data storage
 CloudFunctions
Your code, our hardware
 Push Notifications
One call – push to all
 Analytics
Improve by understanding your
users
 Multi Platform
All of the mobile platforms in one
place
A PRACTICAL EXAMPLE
4
$39.99
Per month
A small virtual server to
begin
$12,000 2 web developers building
your backend in 3 weeks
$2,000 Adjustments to your backend
$150
Per month
A more powerful production
server
$5,000
Per month
Hire a system administrator
$ ∞ Scale your infrastructure
FREE Sign up with cloudbase.io
$ ? Build your application
$11.99
Per month
Start with a cloudbase.io
basic account
JavaScript - a bit of history
5
1995 Used to be a dirty word
2005 jQuery changed the
game
2011 HTML5/CSS3 go mainstream, responsive web design is
here
2013 10 of the top 20 most popular projects on GitHub are JS
JavaScript goes mobile
6
Modern smartphones include HTML5
and CSS3 compatible browsers
A number of popular web development
framework go mobile and building UI
becomes incredibly simple
We have UI covered – what’s missing?
What’s missing?
7
• Access to the native
APIs
• A real backend
Let’s build an application
8
What we want to try and build is a clone of FourSquare.
It will require:
• Access to the native API for location
• A database to store its data
• Push notifications to share it
The Cloud Database
9
The cloudbase.io Cloud Database is an in-memory object-
oriented NoSql database.
• Store and retrieve complex objects
• Searchable like an SQL database
• Advanced geo-location search
• Files, such as images, can be attached to all documents
SQL Cloud Database
Table Collection
Row Document
The JavaScript helper class
10
• The JavaScript helper class does not depend on any framework
• A number of includes make the various components available
• XMLHttpRequest
• Md5
• Platform specific helper
• CBHelper – the main helper class object
• Data is received through callback methods in the form of a
CBHelperResponseInfo object
• Location data can be sent with each request in the form of a
CBHelperCurrentLocation object
• Files can be attached to cloud database documents and downloaded
as Blob data
User interaction flow
11
1 A user registers or logs in with an existing account
2 The user is presented with a map of other users’ current location
3
The user decides to “check-in” at a location – The current
location is converted to an address and saved in the cloud
4 Nearby users are sent a push notification with the updated location
1 - Login
12
1. Declare and initialize
the cloudbase.io
helper class
2. Do we know the user?
3. Login
var helper;
$(function() {
helper = new CBHelper('app-code', 'app-unique');
helper.setPassword(hex_md5('my-app-password'));
if ( localStorage && localStorage.CloudSquareUser ) {
// we know the user. Load the data and set
// it in the helper class
} else {
// load the login/registration form
}
});
var loginCondition = {
"username" : username.toLowerCase(),
"password" : password
};
helper.searchDocuments(loginCondition, "users", function(resp) {
if ( resp.outputData.length > 0 ) {
document.location.href = 'home.html';
}
});
1.1 - Registration
13
1. Is the username
taken?
1. Create the user
1. Redirect to the main
page
helper.searchDocuments(
{ "username" : username.toLowerCase() },
"users", function(resp) {
if ( resp.callStatus && resp.outputData.length == 0 ) {
var user = {
"username" : username.toLowerCase(),
"password" : hex_md5(password)
};
helper.insertDocument("users", user, null, function(resp) {
if ( resp.callStatus &&
resp.outputData == "Inserted") {
document.location.href = 'home.html';
}
});
}
});
2 - Find other users
14
1. Get the current
position
1. Find users nearby
5KMs in radians
1. Add the user as a pin
on the map
var currentPosition = null;
navigator.geolocation.getCurrentPosition(
function (position) {
currentPosition = new CBHelperCurrentLocation(
position.coords.latitude,
position.coords.longitude,
position.coords.altitude);
});
var search = {
'cb_location' : {
'$near' : [ currentPosition.lat, currentPosition.lng ],
'$maxDistance' : (5000/1000)/111.12
}
};
helper.searchDocuments(search, "latest_position", function(resp) {
if ( resp.callStatus ) {
for ( index in resp.outputData ) {
var user = resp.outputData[index];
var userPos = new google.maps.LatLng(
user.cb_location.lat, user.cb_location.lng);
}
}
});
3 - Checkin
15
1. Get the address from
the position using a
cloudbase.io applet
2. Read the current
address
1. Create the new
checkin object and add
it to the history
1. The helper class will
send the current
position automatically
so long as the
currentLocation
property is set
helper.executeApplet("cb_get_address_from_coordinates",
{ "lat" : currentPosition.lat,
"lng" : currentPosition.lng }, function(resp) {
var address = resp.outputData["return"].formatted_address;
var newCheckin = {
"user" : user,
"address" : address,
"time" : new Date().getTime()
}
helper.insertDocument(
"checkins", newCheckin, null, function(resp) {
});
});
3.1 – Checkin, latest position
16
1. Check if we already
have a record of the
user’s position
2. If we already have a
latest position update
the existing record
1. Insert a new record for
the user
helper.searchDocuments(
{ "user" : user },
"latest_position",
function(searchResp) {
if ( searchResp.outputData.length > 0 ) {
helper.updateDocument(
newCheckin, { "user" : user }, "latest_position", null,
function(updateResp) {
mosync.rlog(updateResp.outputString);
});
} else {
helper.insertDocument(
"latest_position",
newCheckin, null,
function(insertResp) {
mosync.rload(insertResp.outputString);
});
}
});
4 – Push notifications
17
1. When the application
starts the device
registers for push
notifications
2. Once we have the
address of the current
location create a
channel for the city
1. Notify all other users in
the same city
var pushManager = new PushNotificationManager();
pushManager.register(function(token) {
// subscribe the current device to the push notification channel
pushToken = token;
},
function(error) {
mosync.rlog("Error " + JSON.stringify(error));
});
if ( curComponent.types && curComponent.types.length > 0 &&
curComponent.types[0] == "administrative_area_level_2" ) {
city = curComponent.short_name;
helper.registerDeviceForNotifications(
pushToken, city,
function(registrationOutcome) {
mosync.rlog(”Registered”);
});
}
if ( city != "" && pushToken ) {
// the last parameter is the iOS certificate type
helper.sendNotification("I'm in " + city, city, "development");
}
4.1 – Automated push notifications
18
An alternative to the method described in slide 4 is to send
push notifications through a Cloud Function attached to the
latest_position collection as a trigger
What next?
19
• Social aspect
• Login with facebook – Social Media Applets cb_facebook_get_profile
• Adding friends to make social groups – Cloud Database
• Comments on checkins – Cloud Database / Push Notifications
• Send direct messages – Cloud Database / Push Notifications
• Invite friends – Cloud Database / Push Notifications
• Media
• Attach photos to checkins – Cloud database
• Additional information
• Create venues instead of address – Cloud Functions / Cloud Database
• Full profile – Cloud Database

More Related Content

What's hot

Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Codemotion
 
Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
Tushar Acharya
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
Nicholas McClay
 
Data sync on iOS with Couchbase Mobile
Data sync on iOS with Couchbase MobileData sync on iOS with Couchbase Mobile
Data sync on iOS with Couchbase Mobile
Thiago Alencar
 
Dbabstraction
DbabstractionDbabstraction
Dbabstraction
Bruce McPherson
 
Building Android apps with Parse
Building Android apps with ParseBuilding Android apps with Parse
Building Android apps with Parse
DroidConTLV
 
OmniBase Object Database
OmniBase Object DatabaseOmniBase Object Database
OmniBase Object Database
ESUG
 
OpenStack Log Mining
OpenStack Log MiningOpenStack Log Mining
OpenStack Log Mining
John Stanford
 
Streaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & ElasticsearchStreaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & Elasticsearch
Keira Zhou
 
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
ITGinGer
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB
 
Google apps script database abstraction exposed version
Google apps script database abstraction   exposed versionGoogle apps script database abstraction   exposed version
Google apps script database abstraction exposed version
Bruce McPherson
 
RESTfull with RestKit
RESTfull with RestKitRESTfull with RestKit
RESTfull with RestKit
Taras Kalapun
 
Implementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and LuaImplementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and Lua
Andrii Gakhov
 
Tools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 EditionTools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 Edition
Jesus Manuel Olivas
 
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowJavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
Robert Nyman
 
Android writing and reading from firebase
Android writing and reading from firebaseAndroid writing and reading from firebase
Android writing and reading from firebase
Osahon Gino Ediagbonya
 
Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stack
Tomáš Kypta
 
Building .NET Apps using Couchbase Lite
Building .NET Apps using Couchbase LiteBuilding .NET Apps using Couchbase Lite
Building .NET Apps using Couchbase Lite
gramana
 
Caching in asp.net
Caching in asp.netCaching in asp.net
Caching in asp.net
MohitKumar1985
 

What's hot (20)

Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
Sebastian Schmidt, Rachel Myers - How To Go Serverless And Not Violate The GD...
 
Intro to Parse
Intro to ParseIntro to Parse
Intro to Parse
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
 
Data sync on iOS with Couchbase Mobile
Data sync on iOS with Couchbase MobileData sync on iOS with Couchbase Mobile
Data sync on iOS with Couchbase Mobile
 
Dbabstraction
DbabstractionDbabstraction
Dbabstraction
 
Building Android apps with Parse
Building Android apps with ParseBuilding Android apps with Parse
Building Android apps with Parse
 
OmniBase Object Database
OmniBase Object DatabaseOmniBase Object Database
OmniBase Object Database
 
OpenStack Log Mining
OpenStack Log MiningOpenStack Log Mining
OpenStack Log Mining
 
Streaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & ElasticsearchStreaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & Elasticsearch
 
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
 
Google apps script database abstraction exposed version
Google apps script database abstraction   exposed versionGoogle apps script database abstraction   exposed version
Google apps script database abstraction exposed version
 
RESTfull with RestKit
RESTfull with RestKitRESTfull with RestKit
RESTfull with RestKit
 
Implementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and LuaImplementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and Lua
 
Tools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 EditionTools and Projects Dec 2018 Edition
Tools and Projects Dec 2018 Edition
 
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, MoscowJavaScript APIs - The Web is the Platform - .toster conference, Moscow
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
 
Android writing and reading from firebase
Android writing and reading from firebaseAndroid writing and reading from firebase
Android writing and reading from firebase
 
Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stack
 
Building .NET Apps using Couchbase Lite
Building .NET Apps using Couchbase LiteBuilding .NET Apps using Couchbase Lite
Building .NET Apps using Couchbase Lite
 
Caching in asp.net
Caching in asp.netCaching in asp.net
Caching in asp.net
 

Similar to Cloudbase.io MoSync Reload Course

Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & Tricks
Hector Ramos
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
WalaSidhom1
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
QuickBase, Inc.
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
Pedro Morais
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!
Luca Lusso
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha
 
Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level 
Hossein Sarshar
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGap
Alex S
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
Maksym Davydov
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
Maksym Davydov
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
Ivano Malavolta
 
DSpace: Technical Basics
DSpace: Technical BasicsDSpace: Technical Basics
DSpace: Technical Basics
Iryna Kuchma
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
Luc Bors
 
Local SQLite Database with Node for beginners
Local SQLite Database with Node for beginnersLocal SQLite Database with Node for beginners
Local SQLite Database with Node for beginners
Laurence Svekis ✔
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
jeromevdl
 
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
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
protofy
 
Life on Clouds: a forensics overview
Life on Clouds: a forensics overviewLife on Clouds: a forensics overview
Life on Clouds: a forensics overview
Reality Net System Solutions
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
IMC Institute
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Software Park Thailand
 

Similar to Cloudbase.io MoSync Reload Course (20)

Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & Tricks
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
 
Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!Do you know what your drupal is doing? Observe it!
Do you know what your drupal is doing? Observe it!
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level 
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGap
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
 
DSpace: Technical Basics
DSpace: Technical BasicsDSpace: Technical Basics
DSpace: Technical Basics
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Local SQLite Database with Node for beginners
Local SQLite Database with Node for beginnersLocal SQLite Database with Node for beginners
Local SQLite Database with Node for beginners
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
 
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...
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
 
Life on Clouds: a forensics overview
Life on Clouds: a forensics overviewLife on Clouds: a forensics overview
Life on Clouds: a forensics overview
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 

Recently uploaded

Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 

Recently uploaded (20)

Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 

Cloudbase.io MoSync Reload Course

  • 1. YOUR APP. OUR CLOUD.
  • 2. THE PROBLEM 2 Vast amounts of time and money is spent building a backend infrastructure The mobile developers business is mobile development 1 Have an idea 2 Define a backend infrastructure Pick a hosting provider 3 Develop your backend software Test the infrastructure 4 Build your mobile application 5 Maintain your infrastructure
  • 3. WHAT IS CLOUDBASE.IO 3 cloudbase.io is the entire backend stack of your mobile application Leaving you free to do what you do best… Build mobile applications  CloudBase Online data storage  CloudFunctions Your code, our hardware  Push Notifications One call – push to all  Analytics Improve by understanding your users  Multi Platform All of the mobile platforms in one place
  • 4. A PRACTICAL EXAMPLE 4 $39.99 Per month A small virtual server to begin $12,000 2 web developers building your backend in 3 weeks $2,000 Adjustments to your backend $150 Per month A more powerful production server $5,000 Per month Hire a system administrator $ ∞ Scale your infrastructure FREE Sign up with cloudbase.io $ ? Build your application $11.99 Per month Start with a cloudbase.io basic account
  • 5. JavaScript - a bit of history 5 1995 Used to be a dirty word 2005 jQuery changed the game 2011 HTML5/CSS3 go mainstream, responsive web design is here 2013 10 of the top 20 most popular projects on GitHub are JS
  • 6. JavaScript goes mobile 6 Modern smartphones include HTML5 and CSS3 compatible browsers A number of popular web development framework go mobile and building UI becomes incredibly simple We have UI covered – what’s missing?
  • 7. What’s missing? 7 • Access to the native APIs • A real backend
  • 8. Let’s build an application 8 What we want to try and build is a clone of FourSquare. It will require: • Access to the native API for location • A database to store its data • Push notifications to share it
  • 9. The Cloud Database 9 The cloudbase.io Cloud Database is an in-memory object- oriented NoSql database. • Store and retrieve complex objects • Searchable like an SQL database • Advanced geo-location search • Files, such as images, can be attached to all documents SQL Cloud Database Table Collection Row Document
  • 10. The JavaScript helper class 10 • The JavaScript helper class does not depend on any framework • A number of includes make the various components available • XMLHttpRequest • Md5 • Platform specific helper • CBHelper – the main helper class object • Data is received through callback methods in the form of a CBHelperResponseInfo object • Location data can be sent with each request in the form of a CBHelperCurrentLocation object • Files can be attached to cloud database documents and downloaded as Blob data
  • 11. User interaction flow 11 1 A user registers or logs in with an existing account 2 The user is presented with a map of other users’ current location 3 The user decides to “check-in” at a location – The current location is converted to an address and saved in the cloud 4 Nearby users are sent a push notification with the updated location
  • 12. 1 - Login 12 1. Declare and initialize the cloudbase.io helper class 2. Do we know the user? 3. Login var helper; $(function() { helper = new CBHelper('app-code', 'app-unique'); helper.setPassword(hex_md5('my-app-password')); if ( localStorage && localStorage.CloudSquareUser ) { // we know the user. Load the data and set // it in the helper class } else { // load the login/registration form } }); var loginCondition = { "username" : username.toLowerCase(), "password" : password }; helper.searchDocuments(loginCondition, "users", function(resp) { if ( resp.outputData.length > 0 ) { document.location.href = 'home.html'; } });
  • 13. 1.1 - Registration 13 1. Is the username taken? 1. Create the user 1. Redirect to the main page helper.searchDocuments( { "username" : username.toLowerCase() }, "users", function(resp) { if ( resp.callStatus && resp.outputData.length == 0 ) { var user = { "username" : username.toLowerCase(), "password" : hex_md5(password) }; helper.insertDocument("users", user, null, function(resp) { if ( resp.callStatus && resp.outputData == "Inserted") { document.location.href = 'home.html'; } }); } });
  • 14. 2 - Find other users 14 1. Get the current position 1. Find users nearby 5KMs in radians 1. Add the user as a pin on the map var currentPosition = null; navigator.geolocation.getCurrentPosition( function (position) { currentPosition = new CBHelperCurrentLocation( position.coords.latitude, position.coords.longitude, position.coords.altitude); }); var search = { 'cb_location' : { '$near' : [ currentPosition.lat, currentPosition.lng ], '$maxDistance' : (5000/1000)/111.12 } }; helper.searchDocuments(search, "latest_position", function(resp) { if ( resp.callStatus ) { for ( index in resp.outputData ) { var user = resp.outputData[index]; var userPos = new google.maps.LatLng( user.cb_location.lat, user.cb_location.lng); } } });
  • 15. 3 - Checkin 15 1. Get the address from the position using a cloudbase.io applet 2. Read the current address 1. Create the new checkin object and add it to the history 1. The helper class will send the current position automatically so long as the currentLocation property is set helper.executeApplet("cb_get_address_from_coordinates", { "lat" : currentPosition.lat, "lng" : currentPosition.lng }, function(resp) { var address = resp.outputData["return"].formatted_address; var newCheckin = { "user" : user, "address" : address, "time" : new Date().getTime() } helper.insertDocument( "checkins", newCheckin, null, function(resp) { }); });
  • 16. 3.1 – Checkin, latest position 16 1. Check if we already have a record of the user’s position 2. If we already have a latest position update the existing record 1. Insert a new record for the user helper.searchDocuments( { "user" : user }, "latest_position", function(searchResp) { if ( searchResp.outputData.length > 0 ) { helper.updateDocument( newCheckin, { "user" : user }, "latest_position", null, function(updateResp) { mosync.rlog(updateResp.outputString); }); } else { helper.insertDocument( "latest_position", newCheckin, null, function(insertResp) { mosync.rload(insertResp.outputString); }); } });
  • 17. 4 – Push notifications 17 1. When the application starts the device registers for push notifications 2. Once we have the address of the current location create a channel for the city 1. Notify all other users in the same city var pushManager = new PushNotificationManager(); pushManager.register(function(token) { // subscribe the current device to the push notification channel pushToken = token; }, function(error) { mosync.rlog("Error " + JSON.stringify(error)); }); if ( curComponent.types && curComponent.types.length > 0 && curComponent.types[0] == "administrative_area_level_2" ) { city = curComponent.short_name; helper.registerDeviceForNotifications( pushToken, city, function(registrationOutcome) { mosync.rlog(”Registered”); }); } if ( city != "" && pushToken ) { // the last parameter is the iOS certificate type helper.sendNotification("I'm in " + city, city, "development"); }
  • 18. 4.1 – Automated push notifications 18 An alternative to the method described in slide 4 is to send push notifications through a Cloud Function attached to the latest_position collection as a trigger
  • 19. What next? 19 • Social aspect • Login with facebook – Social Media Applets cb_facebook_get_profile • Adding friends to make social groups – Cloud Database • Comments on checkins – Cloud Database / Push Notifications • Send direct messages – Cloud Database / Push Notifications • Invite friends – Cloud Database / Push Notifications • Media • Attach photos to checkins – Cloud database • Additional information • Create venues instead of address – Cloud Functions / Cloud Database • Full profile – Cloud Database