rhinos have tea_on_azure

38
Rhinos have tea on Azure Cédric Derue – GWAB 2014

Upload: cedric-derue

Post on 26-Jun-2015

84 views

Category:

Mobile


0 download

DESCRIPTION

This presentation shows how to build Sencha Touch apps connected with Microsoft Azure.

TRANSCRIPT

Page 1: Rhinos have tea_on_azure

Rhinos have tea on Azure

Cédric Derue – GWAB 2014

Page 2: Rhinos have tea_on_azure

Senior consultant @ Altran

Skills:

Zend Framework 2

ASP.NET MVC

JavaScript

NoSQL

Twitter: @cderue

About me

Page 3: Rhinos have tea_on_azure

You love JavaScript,

You love hybrid mobile app programming.

Who this session is for?

Choose your

mobile

development path

Page 4: Rhinos have tea_on_azure

Mobile development paths

Multiple platforms

Single platform

Partial capability

Full capability

HTML5 Web developer skills Instant updates Unrestricted distribution

Hybrid Web developer skills Access to native platform App store distribution

Native Advanced UI interactions Fatest performance App store distribution

Page 5: Rhinos have tea_on_azure

Sencha Touch 2 overview

Sencha Touch Extensions for Azure

Azure Mobile Services overview

Access to data stored in Azure Mobile Services

Custom logic

Authentification

Demo

Agenda

Page 6: Rhinos have tea_on_azure

Sencha Touch is a high-performance, HTML5

mobile app platform with over 50 built-in

components, themes for every mobile

platform, and a built-in MVC system.

Why Sencha Touch 2?

Page 7: Rhinos have tea_on_azure

Sencha Touch 2 components

Page 8: Rhinos have tea_on_azure

Sencha Touch Framework

Sencha Architect IDE

Sencha Cmd CLI

Sencha is not only a framework

Page 9: Rhinos have tea_on_azure

Exploring Sencha Touch Extensions for Azure

Page 10: Rhinos have tea_on_azure

Objectives

Manage tasks in Azure Mobile Services

Authenticate users with theirs social accounts

Push notifications

MyFixIt Sencha app

Page 11: Rhinos have tea_on_azure

Workflow

Page 12: Rhinos have tea_on_azure

Move to Sencha Touch SDK directory

> cd /path/to/sencha-touch-sdk

Generate a new app skeleton

> sencha generate app MyApp /path/to/myapp

Initialize a new Sencha Touch app

Page 13: Rhinos have tea_on_azure

--.sencha

--touch/

--app/

|--controller

|--model

|--profile

|--store

|--view

--resources

|--css

|--sass

--index.html

--app.json

--packager.json

Understanding Sencha Touch 2 app structure

MVC Architecture

Page 14: Rhinos have tea_on_azure

Using default syntax

> sencha app build

[production|testing|native|package]

Using Ant

> sencha ant

[production|testing|native|package] build

Building a Sencha Touch 2 app

Page 15: Rhinos have tea_on_azure

Start the local web server

> sencha web start

Browse localhost at port 1841

http://localhost:1841

Launching a Sencha Touch 2 app in browser

Page 16: Rhinos have tea_on_azure

First sign of life

Page 18: Rhinos have tea_on_azure

"requires": [

"touch-azure"

]

> sencha app build

Add a dependency to your app.json

Page 19: Rhinos have tea_on_azure

Observing the result

Page 20: Rhinos have tea_on_azure

Ext.application({

name: 'MyFixIt',

requires: [ 'Ext.azure.Azure' ]

});

Reference Azure extensions in your app

Page 21: Rhinos have tea_on_azure

Accelerate the deployment of your mobile

backend services to:

Store your data in the cloud with SQL Azure

Expose custom logic by API

Authenticate users

Push notifications

Consume tiers API

Azure Mobile Services overview

Page 22: Rhinos have tea_on_azure

Create a new Azure Mobile Service

Page 23: Rhinos have tea_on_azure

Observing the result

Page 24: Rhinos have tea_on_azure

Exploring Azure Mobile Services

Page 25: Rhinos have tea_on_azure

Generate Access Keys

Page 26: Rhinos have tea_on_azure

Create any data tables your Sencha Touch

application may require for application data

storage.

Add a new table to your mobile service

Page 27: Rhinos have tea_on_azure

var SendGrid = require('sendgrid').SendGrid;

function insert(item, user, request) {

request.execute({

success: function() {

// Proceed insertion

request.respond();

// Send the email in the background

sendEmail(item);

}

});

function sendEmail(item) {

var sendgrid = new SendGrid('<username>', '<password>');

sendgrid.send({

to: '<email>',

from: '<from>',

subject: 'New to-do item',

text: 'A new to-do was added: ' + item.text

}, function(success, message) {

if (!success) console.error(message);

});

}

}

Send SMS from custom API

Page 28: Rhinos have tea_on_azure

Configure Azure in your Sencha app

Ext.application({ azure: { appKey: 'myazureservice-access-key', appUrl: 'myazure-service.azure-mobile.net' }, launch: function() { // Call Azure initialization Ext.Azure.init(this.config.azure); } });

Page 29: Rhinos have tea_on_azure

Configure your social identities

Page 30: Rhinos have tea_on_azure

Ext.application({

azure: {

authIdentities : [

'microsoft',

'facebook',

'twitter',

'google'

]

}

});

Activate authentication on Sencha Touch

Page 31: Rhinos have tea_on_azure

Hybrid app: why and how?

Page 32: Rhinos have tea_on_azure

Install PhoneGap

> npm install -g phonegap

Add support to PhoneGap

> sencha phonegap init <AppID>

Target your device in phonegap.local.properties

phonegap.platforms=<ios android blackberry wp8>

phonegap.build.remote=<false|true>

phonegap.build.remote.username=<username>

phonegap.build.remote.password=<password>

Build into an hybrid app with PhoneGap

Page 33: Rhinos have tea_on_azure

Build and emlulate

> sencha app build -run native

Build only

> sencha app build native

Let’s build and emulate your app

Page 34: Rhinos have tea_on_azure

What else?

Azure Storage Push notifications

Page 35: Rhinos have tea_on_azure

It’s time to demonstrate

Page 36: Rhinos have tea_on_azure

http://www.windowsazure.com/en-

us/documentation/articles/mobile-services-

html-get-started-data/

http://www.windowsazure.com/en-

us/pricing/details/mobile-services/

Resources

Page 37: Rhinos have tea_on_azure

The Azure effects on the body

This is Cloud François!

Page 38: Rhinos have tea_on_azure

Thank you!