Top Banner
CORDOVA + IONIC + MOBILEFIRST
163

Cordova + Ionic + MobileFirst

Apr 15, 2017

Download

Mobile

Raymond Camden
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Cordova + Ionic + MobileFirst

CORDOVA + IONIC +MOBILEFIRST

Page 2: Cordova + Ionic + MobileFirst

WHO AM I?Developer Advocate for IBMFocused on MobileFirst and BluemixWeb Standards, HTML5, JavaScript,Mobile, ColdFusionwww.raymondcamden.com@raymondcamden

Page 3: Cordova + Ionic + MobileFirst
Page 4: Cordova + Ionic + MobileFirst
Page 5: Cordova + Ionic + MobileFirst

First time in Australia!

Page 6: Cordova + Ionic + MobileFirst
Page 7: Cordova + Ionic + MobileFirst
Page 8: Cordova + Ionic + MobileFirst
Page 9: Cordova + Ionic + MobileFirst

WHAT I LEARNEDDon't mention Paul HoganDon't drink FostersOutback Steakhouse isn't

Page 10: Cordova + Ionic + MobileFirst

AGENDAApache Cordova (hybrid apps)Ionic (better hybrid apps)IBM MobileFirst (even better hybrid apps)

Page 11: Cordova + Ionic + MobileFirst

PART ONE - CORDOVA

Page 12: Cordova + Ionic + MobileFirst

GENESIS (OF PHONEGAP)Built at an iPhoneDevCamp in 2009Started by NitobiAdobe bought Nitobi (2011)Currently at 5.1.1

Page 13: Cordova + Ionic + MobileFirst

$$$?PhoneGap is freeNo, really, freeOpen Source

Page 14: Cordova + Ionic + MobileFirst

APACHE CORDOVAcordova.apache.orgPhoneGap is Adobe's implementationPhoneGap == Cordova

Page 15: Cordova + Ionic + MobileFirst

LET'S GET TECHYCreates "Hybrid" applicationsNative wrapper around a web viewHTML (CSS,JS) handles layoutCordova "bridges the gap" to native capabilities

Page 16: Cordova + Ionic + MobileFirst

ABOUT THAT GAP...Cordova tries to follow standardsWhen it doesn't need to do anything, it doesn'tIn the perfect world, Cordova won't exist

Page 17: Cordova + Ionic + MobileFirst

SUPPORTED PLATFORMSiOSAndroidWindows Phone 8BlackBerry 10

(docs.cordova.io)Super Long URL

Page 18: Cordova + Ionic + MobileFirst

OTHER PLATFORMSFirefox OSAmazon Fire OSUbuntuTizenWindows 8

Page 19: Cordova + Ionic + MobileFirst

FEATURES (STUFF YOU CAN DO WITHJAVASCRIPT!)

Accelerometer - when the device movesCamera - pictures of your catCapture - audio, video, stills of your catCompass - for when you're lost in the woodsConnection - type of connection

Page 20: Cordova + Ionic + MobileFirst

FEATURESContacts - find and create new friendsDevice - device and OS version metadataEvents - various app/hardware related eventsFile - native file system access (and upload/download)Geolocation - for when you're lost in the woods

Page 21: Cordova + Ionic + MobileFirst

FEATURESGlobalization - date/number/currency formattingMedia - related to audio playback (supports record as well)Notification - visual, audible, and tactile notificationsSplashscreen - for your splash screen needs

Page 22: Cordova + Ionic + MobileFirst

FEATURESPlugin API for anything you can imagine...

Page 23: Cordova + Ionic + MobileFirst

UNOFFICIAL FEATURESUse any of the 10 million JavaScript librariesUse any of the 10 million APIsDeploy to app store

Page 24: Cordova + Ionic + MobileFirst

NON-FEATURESUIUXNative Killer

Page 25: Cordova + Ionic + MobileFirst

WHO IS USING CORDOVA?

Page 26: Cordova + Ionic + MobileFirst

REAL WORLD DEMO

Page 27: Cordova + Ionic + MobileFirst

HOW IS IT DONE?Going from HTML to BinaryMaking use of the "special" stuffThinking Differently

Page 28: Cordova + Ionic + MobileFirst

HOW IS IT DONE?Install NodeInstall cordova via npm: sudo npm install -g cordova (Windowsfolks open your command prompt as an Admin)Get SDK(s) (technically optional)

Page 29: Cordova + Ionic + MobileFirst

HOW IS IT DONE?Command line init to create the projectSwitch to your editorEdit HTML, simulate, build (via CLI)

Page 30: Cordova + Ionic + MobileFirst

DEMOI'll show creating a project and explain what the folders

represent.

Page 31: Cordova + Ionic + MobileFirst

ADDING PLATFORMScordova platforms add X (to add something)cordova platforms (to report)

Page 32: Cordova + Ionic + MobileFirst

DEMOI'm going to show adding iOS and Android as well as checking

what is there/installed.

Page 33: Cordova + Ionic + MobileFirst

BUILDING/EMULATING/TESTINGpreparecompilebuild == prepare + compileemulaterun

Page 34: Cordova + Ionic + MobileFirst

MY CYCLEedit stuffcordova emulate

Page 35: Cordova + Ionic + MobileFirst

DEMO

Page 36: Cordova + Ionic + MobileFirst

HOW DO WE DO THE AWESOME?Include cordova.js (this will NOT exist in www)Wait for "deviceready" eventplugins for each feature (so to do X, you add the plugin X)config.xml (handles settings)

Page 37: Cordova + Ionic + MobileFirst

DEMOI'm going to demo the camera API and totally screw it up.

Page 38: Cordova + Ionic + MobileFirst

PLUGINSAll core features use pluginsAdditional features use pluginsEverything driven from CLI (list, add, and remove)

Page 39: Cordova + Ionic + MobileFirst

DEMOLet's fix the camera demo.

Page 40: Cordova + Ionic + MobileFirst

DEMOLet's show a few more: demos/contactpickerui,

demos/camera_vintagagejs, demos/mp3

Page 41: Cordova + Ionic + MobileFirst

REAL WORLD BUILDINGDesktop BrowserMobile via WebRipple EmulatorLocal SDK to Simulator/Device

Page 42: Cordova + Ionic + MobileFirst

DESKTOP BROWSERPro: Super FastPro: No setupPro: Debugging Rocks

Con: UI isn't rightCon: UX isn't rightCon: Features missingCon: Security restrictions

Page 43: Cordova + Ionic + MobileFirst

MOBILE VIA WEBPro: Kinda FastPro: Minimal setupPro: UI and UX testing

Con: Features missingCon: Security restrictionsCon: Debugging sucks

Page 44: Cordova + Ionic + MobileFirst

RIPPLE EMULATORPro: FastPro: Similar UIPro: FreePro: Security restrictions gone

Con: Not 100% supportedCon: Still not on the device

Page 45: Cordova + Ionic + MobileFirst

LOCAL SDK TO SIMULATOR/DEVICEPro: The Real Deal

Con: Slow(ish)Con: Not FreeCon: Debugging *really* sucks

TO BE CLEAR: YOU MUST ALWAYS TEST ON A REAL DEVICE

Page 46: Cordova + Ionic + MobileFirst

WHAT RAY DOES (MOST OF THE TIME...)DesktopiOS EmulatorGenymotion for Android: http://www.genymotion.com(Ray, show this)

Page 47: Cordova + Ionic + MobileFirst

TESTING

Page 48: Cordova + Ionic + MobileFirst

TESTINGOn Desktop, just continue to use dev tools.

Page 49: Cordova + Ionic + MobileFirst

TESTINGOn Mobile, just continue to use dev tools.

Page 50: Cordova + Ionic + MobileFirst

REMOTE DEBUGSafari for iOS, Chrome for Android"Full" dev tools for mobile web or Cordova

Page 51: Cordova + Ionic + MobileFirst

DEMO

Page 52: Cordova + Ionic + MobileFirst

GAPDEBUGhttps://www.genuitec.com/products/gapdebug/

Page 53: Cordova + Ionic + MobileFirst

DEMO

Page 54: Cordova + Ionic + MobileFirst

SO WHAT ABOUT THAT WHOLE "THINKDIFFERENT" THING?

Page 55: Cordova + Ionic + MobileFirst

USER INTERFACE

Page 56: Cordova + Ionic + MobileFirst

SUGGESTIONSLibraries (like Bootstrap)Responsive design and testing in general

Page 57: Cordova + Ionic + MobileFirst

USER EXPERIENCE

Page 58: Cordova + Ionic + MobileFirst

SUGGESTIONSLibraries (again)Testing on devicesHandling offline with client-side storage

Page 59: Cordova + Ionic + MobileFirst

ARCHITECTURE

Page 60: Cordova + Ionic + MobileFirst

SUGGESTIONSSingle Page ArchitectureAngularJS, jQuery Mobile, etc

Page 61: Cordova + Ionic + MobileFirst

ALL IN ONE SOLUTION

Page 62: Cordova + Ionic + MobileFirst

IONICFRAMEWORK.COM

Page 63: Cordova + Ionic + MobileFirst

PHONEGAP BUILD

Page 64: Cordova + Ionic + MobileFirst

THE 411Web based platform to do buildsSupports iOS, Android, Windows Phone, Blackberry, webOS,SymbianHas an API tooNO SDKS NO COMPILING NO MESS!

Page 65: Cordova + Ionic + MobileFirst

$$$

Page 66: Cordova + Ionic + MobileFirst

DEMO

Page 67: Cordova + Ionic + MobileFirst

PHONEGAP DEVELOPERAPP

Page 68: Cordova + Ionic + MobileFirst

Connects your desktop to your physical device (ios, android,windows phone)

Page 69: Cordova + Ionic + MobileFirst

DEMO

Page 70: Cordova + Ionic + MobileFirst

WHAT TO GO NEXT?Help - Google Group for PhoneGapDevelopers - people.phonegap.comcordova.apache.orgplugins.cordova.io

Page 71: Cordova + Ionic + MobileFirst

"APACHE CORDOVA IN ACTION"

manning.com/camden

Page 72: Cordova + Ionic + MobileFirst

THANK YOU!

Page 73: Cordova + Ionic + MobileFirst
Page 74: Cordova + Ionic + MobileFirst

WHAT IS IT?

Page 75: Cordova + Ionic + MobileFirst

"The beautiful, open source front-end SDK fordeveloping hybrid mobile apps with HTML5."

ionicframework.com

Page 76: Cordova + Ionic + MobileFirst

WHAT'S IN IT?

Page 77: Cordova + Ionic + MobileFirst

ANOTHER UI FRAMEWORK!!!!

Page 78: Cordova + Ionic + MobileFirst
Page 79: Cordova + Ionic + MobileFirst

CLI

Page 80: Cordova + Ionic + MobileFirst

WTF

Page 81: Cordova + Ionic + MobileFirst

WHAT'S IN IT?UI componentsUX componentsSPA Framework (AngularJS)Built for Hybrid Mobile development (Cordova)

Page 82: Cordova + Ionic + MobileFirst

CORDOVA

Page 83: Cordova + Ionic + MobileFirst

CORDOVA + IONIC

Page 84: Cordova + Ionic + MobileFirst

OPEN SOURCE AND FREE

Page 85: Cordova + Ionic + MobileFirst

WHAT YOU NEED TOKNOW

Page 86: Cordova + Ionic + MobileFirst

PhoneGap/CordovaAngularJS

Page 87: Cordova + Ionic + MobileFirst
Page 88: Cordova + Ionic + MobileFirst

INSTALLATION

Page 89: Cordova + Ionic + MobileFirst

Zip downloadnpm installTO BE CLEAR: It doesn't do Cordova/SDKs

sudo npm install -g ionic

Page 90: Cordova + Ionic + MobileFirst

THE CLI

Page 91: Cordova + Ionic + MobileFirst

Creates projectsHandle plugins, platformsEmulate/RunBuild/PackageUpdate libraryServe to BrowserHandle Icon/Splash creationMore

Page 92: Cordova + Ionic + MobileFirst

PROJECT CREATIONionic start APPNAMEionic start APPNAME TEMPLATETemplates: (can be listed from CLI)CodePenDirectory

Page 93: Cordova + Ionic + MobileFirst

DEMO

Page 94: Cordova + Ionic + MobileFirst

IONIC TESTING/EMULATING/ETCionic serveionic emulate/run

Page 95: Cordova + Ionic + MobileFirst

DEMO

Page 96: Cordova + Ionic + MobileFirst

CSS COMPONENTS

Page 97: Cordova + Ionic + MobileFirst
Page 98: Cordova + Ionic + MobileFirst
Page 99: Cordova + Ionic + MobileFirst

JAVASCRIPT

Page 100: Cordova + Ionic + MobileFirst

WHAT WE MEAN BY JAVASCRIPT...UI stuffUX stuffDirectives too!

Page 101: Cordova + Ionic + MobileFirst

<ion-header-bar align-title="left" class="bar-positive"><h1 class="title">Title!</h1></ion-header-bar>

Page 102: Cordova + Ionic + MobileFirst

<ion-slide-box on-slide-changed="slideHasChanged($index)"><ion-slide> <div class="box blue"><h1>BLUE</h1></div></ion-slide><ion-slide> <div class="box yellow"><h1>YELLOW</h1></div></ion-slide><ion-slide> <div class="box pink"><h1>PINK</h1></div></ion-slide></ion-slide-box>

Page 103: Cordova + Ionic + MobileFirst
Page 104: Cordova + Ionic + MobileFirst

DEMO

Page 105: Cordova + Ionic + MobileFirst

ROUTINGVarious directivesion-nav-view, ion-view, ion-nav-bar

Page 106: Cordova + Ionic + MobileFirst

DEMO

Page 107: Cordova + Ionic + MobileFirst
Page 108: Cordova + Ionic + MobileFirst

IONIC CREATORcreator.ionic.io

Page 109: Cordova + Ionic + MobileFirst

IONICONS.COM

Page 110: Cordova + Ionic + MobileFirst

ICON/SPLASHSCREEN GENERATION

Page 111: Cordova + Ionic + MobileFirst

IONIC VIEW (VIEW.IONIC.IO)

Page 112: Cordova + Ionic + MobileFirst

PLAYGROUNDhttp://play.ionic.io/

Page 113: Cordova + Ionic + MobileFirst
Page 114: Cordova + Ionic + MobileFirst

IONIC MARKETmarket.ionic.io

Page 115: Cordova + Ionic + MobileFirst

PUSH SERVICE (ALPHA)

Page 116: Cordova + Ionic + MobileFirst

ANALYTIC SERVICE (ALPHA)Track user interactionHeat maps

Page 117: Cordova + Ionic + MobileFirst

DEPLOY SERVICE (ALPHA)Deploy updates w/o app store updatesSupports channels (for things like beta testers)

Page 118: Cordova + Ionic + MobileFirst

BUILD SERVICE (NOT RELEASED YET)Similar to PhoneGap Build but focused on Ionic apps.

Page 119: Cordova + Ionic + MobileFirst

MORE...Better Windows Phone supportBetter support for native scrollingVisual Studio template support

Page 120: Cordova + Ionic + MobileFirst

LEARNING MORElearn.ionicframework.comhttp://codepen.io/ionic/"Ionic in Action" - http://www.manning.com/wilken/"Cats with Cordova" - http://www.manning.com/camden/

Title not final.

Page 121: Cordova + Ionic + MobileFirst

COOL EXAMPLES:SHOWCASE.IONICFRAMEWORK.COM

Page 122: Cordova + Ionic + MobileFirst

REAL APPWarning - Sappy Story Coming

Page 123: Cordova + Ionic + MobileFirst

SUMMARY

Page 124: Cordova + Ionic + MobileFirst

CORDOVA GOOD

Page 125: Cordova + Ionic + MobileFirst

IONIC EPIC

Page 126: Cordova + Ionic + MobileFirst

CORDOVA + IONIC...

Page 127: Cordova + Ionic + MobileFirst
Page 128: Cordova + Ionic + MobileFirst

PART 3 - MOBILEFIRST

Page 129: Cordova + Ionic + MobileFirst
Page 130: Cordova + Ionic + MobileFirst
Page 131: Cordova + Ionic + MobileFirst
Page 132: Cordova + Ionic + MobileFirst

FYI - 7.1I'm using 7.1, which was VERY recently released.

Page 133: Cordova + Ionic + MobileFirst

MOBILEFIRST

Page 134: Cordova + Ionic + MobileFirst

MOBILEFIRSTSupports mobile appsMobile web, hybrid, nativeCLI to work with projectsServer

Page 135: Cordova + Ionic + MobileFirst
Page 136: Cordova + Ionic + MobileFirst
Page 137: Cordova + Ionic + MobileFirst

FEATURESService ProxiesPush notificationsVersion managementSecurityAnalyticsTesting (IBM MobileFirst Platform Test Workbench)App Store (Enterprise-y)

Page 138: Cordova + Ionic + MobileFirst

MORE FEATURESClient-side utilities

Some examples:Get available wifi pointsGeography stuff (distance to...)Talking to a native class

Logging framework

Page 139: Cordova + Ionic + MobileFirst

PARTSMobileFirst StudioCLIServerWeb console and analytics tool

Page 140: Cordova + Ionic + MobileFirst

EDITIONS/HOW TO USE ITIBM MobileFirst Platform Foundation Developer EditionIBM MobileFirst Platform FoundationA few other fancy versions we don't need to worry abouttoday

Page 141: Cordova + Ionic + MobileFirst

SUPPORTED OSWindowsLinuxMacAIX, Solaris

Page 142: Cordova + Ionic + MobileFirst

INSTALLATIONThis is where I'll pretend to install stuff...

Page 143: Cordova + Ionic + MobileFirst

Product Link: http://www.ibm.com/mobilefirst/us/en/

Page 144: Cordova + Ionic + MobileFirst

Product Link: http://www.ibm.com/cloud-computing/bluemix/

Page 145: Cordova + Ionic + MobileFirst

To be clear, everything I'm showing is free for you to play with.

Page 146: Cordova + Ionic + MobileFirst

WORKING WITH THE CLICreate a server (one time!)Start the serverCreate a hybrid MFP appWrite code and iterate

Page 147: Cordova + Ionic + MobileFirst

CREATING AND STARTING THE SERVERmfp create servername mfp start

Page 148: Cordova + Ionic + MobileFirst

DEMO

Page 149: Cordova + Ionic + MobileFirst

CREATING A HYBRID APPmfp cordova create

Page 150: Cordova + Ionic + MobileFirst

DEMO

Page 151: Cordova + Ionic + MobileFirst

WORKING WITH HYBRID APPSmfp cordova *

Page 152: Cordova + Ionic + MobileFirst

DEMO

Page 153: Cordova + Ionic + MobileFirst

BACK TO SERVERmfp push mfp console

Page 154: Cordova + Ionic + MobileFirst

DEMO

Page 155: Cordova + Ionic + MobileFirst

CLIENT-SIDE APIBasically - "extended" featuresLoggingGet WiFi pointsCall native functionalityMore...WL.* API

Page 156: Cordova + Ionic + MobileFirst

DEMO

Page 157: Cordova + Ionic + MobileFirst

ADAPTERSGlue between your mobile app and stuffServer-specificJava or JavaScript (reminder...)Setup via Studio or CLI

Page 158: Cordova + Ionic + MobileFirst

ADAPTERS - TYPESHTTPSQLCast Iron, Java, JMS, SAP JCo, SAP

Page 159: Cordova + Ionic + MobileFirst

CREATING ADAPTERSmfp adapter add //createmfp push //push and deploy changesmfp adapter call //testmfp adapter call adapter/procedure '["arg"]' //passing an arg

Page 160: Cordova + Ionic + MobileFirst

DEMO

Page 161: Cordova + Ionic + MobileFirst

MORE STUFF

Page 162: Cordova + Ionic + MobileFirst

APPLICATION MESSAGES

Page 163: Cordova + Ionic + MobileFirst

MOBILE BROWSERSIMULATOR