Download - From website to mobile app - a journey

Transcript
Page 1: From website to mobile app - a journey

From web sitesto web appsto mobile apps

An interesting journey

Page 2: From website to mobile app - a journey

The past: Web sites

Page 3: From website to mobile app - a journey

Today: Web apps

Page 4: From website to mobile app - a journey

Today: Web apps

● Single page applications● Communication via API● "Backend as a service"● Client side MV*-Frameworks● Templates rendered on the client● Data on the wire

Page 5: From website to mobile app - a journey

Going mobile

With web technologies

Page 6: From website to mobile app - a journey

Pick one

First fundamental question:

HTML / CSS / JSvs.

Pure JavaScript

Page 7: From website to mobile app - a journey

Pick one

First fundamental decision:

HTML / CSS / JSvs.

Pure JavaScript

Page 8: From website to mobile app - a journey

A tough choice● Javascript MV* Libraries / Frameworks

○ Backbone○ Ember○ Knockout○ Angular

● UI Frameworks○ Lungo○ Kendo○ jQTouch○ jQuery mobile

● Deployment frameworks○ PhoneGap○ Sencha○ Calatrava○ The M-Project

Page 9: From website to mobile app - a journey

A tough choice● Javascript MV* Libraries / Frameworks

○ Backbone○ Ember○ Knockout○ Angular

● UI Frameworks○ Lungo○ Kendo○ jQTouch○ jQuery mobile

● Deployment frameworks○ PhoneGap○ Sencha○ Calatrava○ The M-Project

Page 10: From website to mobile app - a journey

Problems with picking the right mix

● overlap between the three:○ multiple frameworks trying to be clever○ e.g. Calatrava: Deployment & UI○ e.g. Kendo: MVVM & UI

● finding good combinations:○ Knockout & Lungo○ Knockout & Kendo○ Angular & iUI○ Angular & Lungo

Page 11: From website to mobile app - a journey

Our stack

Rails-APIAngular JS

LungoPhoneGap

Page 12: From website to mobile app - a journey

Our stack

Rails-APIAngular JS

Lungo-Angular-BridgeLungo

PhoneGap

Page 13: From website to mobile app - a journey

What's the bridge?

Lungo Angular

Routing

Page 14: From website to mobile app - a journey

Two choices:

● I want the Lungo routing○ The Angular-Lungo-Adapter is for you

● I want the Angular routing○ There is nothing for that

Page 15: From website to mobile app - a journey

Two choices:

● I want the Lungo routing○ The Angular-Lungo-Adapter is for you

● I want the Angular routing○ There was nothing for that

Centralway proudly presents...

Page 16: From website to mobile app - a journey

Lungo-Angular-BridgeBatteries included!

https://github.com/centralway/lungo-angular-bridge

Page 17: From website to mobile app - a journey

● Allows to use Lungo fancyness together with Angular awesomeness

● Use Angular routes but leverage Lungo transitions

● Comes with a set of examples● Extends Angular with the lab-view directive

LAB - Lungo Angular Bridge

Page 18: From website to mobile app - a journey

Batteries included - get going!

Page 19: From website to mobile app - a journey

Demo time!Fasten your seatbelts

Page 20: From website to mobile app - a journey

Experiences & Learnings from us

Page 21: From website to mobile app - a journey

Things you may hear

● "But it's soo slooooow"

● "What if you need something native?"

● "How does deployment work?"

● "But it won't look&feel native!"

Page 22: From website to mobile app - a journey

Things you may say

● "But it's soo slooooow"

● "What if you need something native?"

● "How does deployment work?"

● "But it won't look&feel native!"

○ Only in a few cases, e.g. SVG on iPhone 4

○ You can do that >> Phonegap Plugins

○ Either manually or via App Stores

○ This depends solely on the UI Framework used - e.g. Lungo makes it feel native

Page 23: From website to mobile app - a journey

In the trenches

The pitfalls of mobile development

Page 24: From website to mobile app - a journey

<iframe src="http://example.com"></iframe>

<a href="http://somesite.com" target="_blank">Open</a>

What will happen?● Android

○ iframe loads in the page○ link opens a browser window

● iOS○ "stay-in-webview=false" (default)

■ iframe opens a new browser window■ link opens a new browser window

○ "stay-in-webview=true"■ iframe opens in the page■ link opens in the page

Round 1: iframes vs. iOS

Page 25: From website to mobile app - a journey

Round 1: iframes vs. iOS

● 4 possible solutionsa. using "access" rule in Config.xmlb. using "InApp-Browser" (window.open)c. specify target="_self" for iframed. using ChildBrowser plugin

Page 26: From website to mobile app - a journey

Round 1: iframe vs. iOS

● 4 possible solutionsa. using "access" rule in Config.xmlb. using "InApp-Browser" (window.open)c. specify target="_self" for iframed. using ChildBrowser plugin

Page 27: From website to mobile app - a journey

Round 2: "HTML5 routing"$locationProvider.html5Mode(true);

Page 28: From website to mobile app - a journey

Round 2: "HTML5 routing"$locationProvider.html5Mode(false);

● HTML 5 routing not supported properly○ weird behaviour○ non-routing relating things go wrong○ no error messages / warnings

● Setting to "false" uses "#/..."-style routing instead of "real" routing ("/...")

Page 29: From website to mobile app - a journey

General conclusions

● PhoneGap plugins <3○ when it doesn't exist in PhoneGap○ when it is too slow in HTML / CSS / JS

● Active communities & many resources● Web is a powerful platform

Page 30: From website to mobile app - a journey

Wrap-up

● Mobile is on the rise● Web technologies rock!● Find the right mix of Frameworks for your

needs is hard● Be aware of potential pitfalls● Leverage the active communities to work

around problems

Page 31: From website to mobile app - a journey