Gmail Android
Play Music Android
Whatsapp Android
This Is Called Lie-Fi. Your Phone Has No Signal, But It Makes You Believe It Does.
Web App
Service Worker
Server
Users are case workers
They Interview their clients off site
The clients fill a questionnaire
They go back to office & Fill on their PC
this.db = new PouchDB('mytestdb');
this.username = 'YOUR USERNAME';
this.password = 'YOUR PASSWORD';
this.remote = 'YOUR BLUEMIX URL';
let options = {
live: true,
retry: true,
continuous: true,
auth: {
username: this.username,
password: this.password
}
};
this.db.sync(this.remote, options);
db.put({
_id: 'dave@gmail.com',
name: 'David',
age: 69
});
db.get('mydoc').then(function(doc) {
return db.put({
_id: 'mydoc',
_rev: doc._rev,
title: "Let's Dance"
});
db.post({
title: 'Ziggy Stardust'
})
{
"ok" : true,
"id" : "8A2C3761-FFD5-4770-9B8C-38C33CED300A",
"rev" : "1-d3a8e0e5aa7c8fff0c376dac2d8a4007"
}
View
Model
View
Model
Cloud DB
Remember Firebase?
View
Model
Cloud DB
Local DB
var sync = PouchDB.sync('mydb', 'http://localhost:5984/mydb', {
live: true,
retry: true
}).on('change', function (info) {
// handle change
}).on('paused', function (err) {
// replication paused (e.g. replication up to date, user went offline)
}).on('active', function () {
// replicate resumed (e.g. new changes replicating, user went back online)
}).on('denied', function (err) {
// a document failed to replicate (e.g. due to permissions)
}).on('complete', function (info) {
// handle complete
}).on('error', function (err) {
// handle error
});
sync.cancel(); // whe
IBM Cloudant Is Great :)
That's Some Bad Ass Combo
db.find({
selector: {name: 'Mario'},
fields: ['_id', 'name'],
sort: ['name']
});
db.find({
selector: {
series: 'Mario',
debut: { $gt: 1990 }
}
}
Kevin Perree (https://github.com/numerized)
Hausa For Any Questions?