Ticket to Ride: Offline Hybrid Mobile Apps

Post on 22-Nov-2014

139 views 3 download

Tags:

description

Join Force.com's MVP Keir Bowden as he demonstrates a pair of hybrid applications that allow passengers to download tickets for use even when offline, and drivers to scan the ticket from the traveler's mobile device and register the passenger's presence on the journey. You'll see specific code examples of offline storage, QR code generation, and scanner integration.

Transcript of Ticket to Ride: Offline Hybrid Mobile Apps

Ticket to rideTicket to ride

Keir Bowden, BrightGen, CTO

@bob_buzzard

About me CTO of BrightGen

5 years Force.com

Force.com MVP

Enterprise Java background

When mobile web apps aren’t enough

You need access to device features but don’t want to learn a

new programming language per platform

Here’s how to leverage your existing web skills using the

Salesforce Mobile SDK ...

Tickets app flow

1. Download Tickets1. Download Tickets

2. Store Offline2. Store Offline 3. Present Code3. Present Code

Driver app flow

1. Sign in to service1. Sign in to service

2. Touch to scan2. Touch to scan

3. Scan code and validate3. Scan code and validate

4. Consume ticket4. Consume ticket

Mobile options

Tickets app

HybridApplication

HybridApplication

iOSiOS V 1.3V 1.3 RESTToolkitRESTToolkit

Smart Store

Smart Store

Driver app

HybridApplication

HybridApplication

iOSiOS V 1.3V 1.3 RESTToolkitRESTToolkit

Scanner Plugin

Scanner Plugin

Demo Retrieving tickets and presenting a ticket code

Scanning and verifying the ticket

A look at the code:• Store.js - Smartstore integration

• Tickets.js – interface between store and UI

• Scan.js – Scanner integration

Lesson 1: Storyboard the application

Especially single page applications!

Map pages to functionality

Lesson 2: Professional JavaScript Avoid anonymous functions

Use your own namespace

Don’t tie behaviour to content

Lesson 3: Use the discussion boards You aren’t the first

Leverage the community

Access the SDK developers

Lesson 4: Terminology Cordova ≈ Linux

Phonegap ≈ RedHat

Used interchangeably

Keir BowdenKeir Bowden

CTO, BrightGen@bob_buzzard