CORDOVA + IONIC +
MOBILEFIRST
WHO AM I?
Developer Advocate for IBM
Focused on MobileFirst and Bluemix
Web Standards, HTML5, JavaScript,
Mobile, ColdFusion
www.raymondcamden.com
@raymondcamden
First time in Australia!
WHAT I LEARNED
Don't mention Paul Hogan
Don't drink Fosters
Outback Steakhouse isn't
AGENDA
Apache Cordova (hybrid apps)
Ionic (better hybrid apps)
IBM MobileFirst (even better hybrid apps)
PART ONE - CORDOVA
GENESIS (OF PHONEGAP)
Built at an iPhoneDevCamp in 2009
Started by Nitobi
Adobe bought Nitobi (2011)
Currently at 5.1.1
$$$?
PhoneGap is free
No, really, free
Open Source
APACHE CORDOVA
cordova.apache.org
PhoneGap is Adobe's implementation
PhoneGap == Cordova
LET'S GET TECHY
Creates "Hybrid" applications
Native wrapper around a web view
HTML (CSS,JS) handles layout
Cordova "bridges the gap" to native capabilities
ABOUT THAT GAP...
Cordova tries to follow standards
When it doesn't need to do anything, it doesn't
In the perfect world, Cordova won't exist
SUPPORTED PLATFORMS
iOS
Android
Windows Phone 8
BlackBerry 10
(docs.cordova.io)Super Long URL
OTHER PLATFORMS
Firefox OS
Amazon Fire OS
Ubuntu
Tizen
Windows 8
FEATURES (STUFF YOU CAN DO WITH
JAVASCRIPT!)
Accelerometer - when the device moves
Camera - pictures of your cat
Capture - audio, video, stills of your cat
Compass - for when you're lost in the woods
Connection - type of connection
FEATURES
Contacts - find and create new friends
Device - device and OS version metadata
Events - various app/hardware related events
File - native file system access (and upload/download)
Geolocation - for when you're lost in the woods
FEATURES
Globalization - date/number/currency formatting
Media - related to audio playback (supports record as well)
Notification - visual, audible, and tactile notifications
Splashscreen - for your splash screen needs
FEATURES
Plugin API for anything you can imagine...
UNOFFICIAL FEATURES
Use any of the 10 million JavaScript libraries
Use any of the 10 million APIs
Deploy to app store
NON-FEATURES
UI
UX
Native Killer
WHO IS USING CORDOVA?
REAL WORLD DEMO
HOW IS IT DONE?
Going from HTML to Binary
Making use of the "special" stuff
Thinking Differently
HOW IS IT DONE?
Install Node
Install cordova via npm: sudo npm install -g cordova (Windows
folks open your command prompt as an Admin)
Get SDK(s) (technically optional)
HOW IS IT DONE?
Command line init to create the project
Switch to your editor
Edit HTML, simulate, build (via CLI)
DEMO
I'll show creating a project and explain what the folders
represent.
ADDING PLATFORMS
cordova platforms add X (to add something)
cordova platforms (to report)
DEMO
I'm going to show adding iOS and Android as well as checking
what is there/installed.
BUILDING/EMULATING/TESTING
prepare
compile
build == prepare + compile
emulate
run
MY CYCLE
edit stuff
cordova emulate
DEMO
HOW DO WE DO THE AWESOME?
Include cordova.js (this will NOT exist in www)
Wait for "deviceready" event
plugins for each feature (so to do X, you add the plugin X)
config.xml (handles settings)
DEMO
I'm going to demo the camera API and totally screw it up.
PLUGINS
All core features use plugins
Additional features use plugins
Everything driven from CLI (list, add, and remove)
DEMO
Let's fix the camera demo.
DEMO
Let's show a few more: demos/contactpickerui,
demos/camera_vintagagejs, demos/mp3
REAL WORLD BUILDING
Desktop Browser
Mobile via Web
Ripple Emulator
Local SDK to Simulator/Device
DESKTOP BROWSER
Pro: Super Fast
Pro: No setup
Pro: Debugging Rocks
Con: UI isn't right
Con: UX isn't right
Con: Features missing
Con: Security restrictions
MOBILE VIA WEB
Pro: Kinda Fast
Pro: Minimal setup
Pro: UI and UX testing
Con: Features missing
Con: Security restrictions
Con: Debugging sucks
RIPPLE EMULATOR
Pro: Fast
Pro: Similar UI
Pro: Free
Pro: Security restrictions gone
Con: Not 100% supported
Con: Still not on the device
LOCAL SDK TO SIMULATOR/DEVICE
Pro: The Real Deal
Con: Slow(ish)
Con: Not Free
Con: Debugging *really* sucks
TO BE CLEAR: YOU MUST ALWAYS TEST ON A REAL DEVICE
WHAT RAY DOES (MOST OF THE TIME...)
Desktop
iOS Emulator
Genymotion for Android: http://www.genymotion.com
(Ray, show this)
TESTING
TESTING
On Desktop, just continue to use dev tools.
TESTING
On Mobile, just continue to use dev tools.
REMOTE DEBUG
Safari for iOS, Chrome for Android
"Full" dev tools for mobile web or Cordova
DEMO
GAPDEBUG
https://www.genuitec.com/products/gapdebug/
DEMO
SO WHAT ABOUT THAT WHOLE "THINK
DIFFERENT" THING?
USER INTERFACE
SUGGESTIONS
Libraries (like Bootstrap)
Responsive design and testing in general
USER EXPERIENCE
SUGGESTIONS
Libraries (again)
Testing on devices
Handling offline with client-side storage
ARCHITECTURE
SUGGESTIONS
Single Page Architecture
AngularJS, jQuery Mobile, etc
ALL IN ONE SOLUTION
IONICFRAMEWORK.COM
PHONEGAP BUILD
THE 411
Web based platform to do builds
Supports iOS, Android, Windows Phone, Blackberry, webOS,
Symbian
Has an API too
NO SDKS NO COMPILING NO MESS!
$$$
DEMO
PHONEGAP DEVELOPER
APP
Connects your desktop to your physical device (ios, android,
windows phone)
DEMO
WHAT TO GO NEXT?
Help - Google Group for PhoneGap
Developers - people.phonegap.com
cordova.apache.org
plugins.cordova.io
"APACHE CORDOVA IN ACTION"
manning.com/camden
THANK YOU!
WHAT IS IT?
"The beautiful, open source front-end SDK for
developing hybrid mobile apps with HTML5."
ionicframework.com
WHAT'S IN IT?
ANOTHER UI FRAMEWORK!!!!
CLI
WTF
WHAT'S IN IT?
UI components
UX components
SPA Framework (AngularJS)
Built for Hybrid Mobile development (Cordova)
CORDOVA
CORDOVA + IONIC
OPEN SOURCE AND FREE
WHAT YOU NEED TO
KNOW
PhoneGap/Cordova
AngularJS
INSTALLATION
Zip download
npm install
TO BE CLEAR: It doesn't do Cordova/SDKs
sudo npm install -g ionic
THE CLI
Creates projects
Handle plugins, platforms
Emulate/Run
Build/Package
Update library
Serve to Browser
Handle Icon/Splash creation
More
PROJECT CREATION
ionic start APPNAME
ionic start APPNAME TEMPLATE
Templates: (can be listed from CLI)
CodePen
Directory
DEMO
IONIC TESTING/EMULATING/ETC
ionic serve
ionic emulate/run
DEMO
CSS COMPONENTS
JAVASCRIPT
WHAT WE MEAN BY JAVASCRIPT...
UI stuff
UX stuff
Directives too!
<ion-header-baralign-title="left"class="bar-positive">
<h1class="title">Title!</h1>
</ion-header-bar>
<ion-slide-boxon-slide-changed="slideHasChanged($index)">
<ion-slide>
<divclass="boxblue"><h1>BLUE</h1></div>
</ion-slide>
<ion-slide>
<divclass="boxyellow"><h1>YELLOW</h1></div>
</ion-slide>
<ion-slide>
<divclass="boxpink"><h1>PINK</h1></div>
</ion-slide>
</ion-slide-box>
DEMO
ROUTING
Various directives
ion-nav-view, ion-view, ion-nav-bar
DEMO
IONIC CREATOR
creator.ionic.io
IONICONS.COM
ICON/SPLASHSCREEN GENERATION
IONIC VIEW (VIEW.IONIC.IO)
PLAYGROUND
http://play.ionic.io/
IONIC MARKET
market.ionic.io
PUSH SERVICE (ALPHA)
ANALYTIC SERVICE (ALPHA)
Track user interaction
Heat maps
DEPLOY SERVICE (ALPHA)
Deploy updates w/o app store updates
Supports channels (for things like beta testers)
BUILD SERVICE (NOT RELEASED YET)
Similar to PhoneGap Build but focused on Ionic apps.
MORE...
Better Windows Phone support
Better support for native scrolling
Visual Studio template support
LEARNING MORE
learn.ionicframework.com
http://codepen.io/ionic/
"Ionic in Action" - http://www.manning.com/wilken/
"Cats with Cordova" - http://www.manning.com/camden/
Title not final.
COOL EXAMPLES:
SHOWCASE.IONICFRAMEWORK.COM
REAL APP
Warning - Sappy Story Coming
SUMMARY
CORDOVA GOOD
IONIC EPIC
CORDOVA + IONIC...
PART 3 - MOBILEFIRST
FYI - 7.1
I'm using 7.1, which was VERY recently released.
MOBILEFIRST
MOBILEFIRST
Supports mobile apps
Mobile web, hybrid, native
CLI to work with projects
Server
FEATURES
Service Proxies
Push notifications
Version management
Security
Analytics
Testing (IBM MobileFirst Platform Test Workbench)
App Store (Enterprise-y)
MORE FEATURES
Client-side utilities
Some examples:
Get available wifi points
Geography stuff (distance to...)
Talking to a native class
Logging framework
PARTS
MobileFirst Studio
CLI
Server
Web console and analytics tool
EDITIONS/HOW TO USE IT
IBM MobileFirst Platform Foundation Developer Edition
IBM MobileFirst Platform Foundation
A few other fancy versions we don't need to worry about
today
SUPPORTED OS
Windows
Linux
Mac
AIX, Solaris
INSTALLATION
This is where I'll pretend to install stuff...
Product Link: http://www.ibm.com/mobilefirst/us/en/
Product Link: http://www.ibm.com/cloud-computing/bluemix/
To be clear, everything I'm showing is free for you to play with.
WORKING WITH THE CLI
Create a server (one time!)
Start the server
Create a hybrid MFP app
Write code and iterate
CREATING AND STARTING THE SERVER
mfpcreateservername
mfpstart
DEMO
CREATING A HYBRID APP
mfpcordovacreate
DEMO
WORKING WITH HYBRID APPS
mfpcordova*
DEMO
BACK TO SERVER
mfppush
mfpconsole
DEMO
CLIENT-SIDE API
Basically - "extended" features
Logging
Get WiFi points
Call native functionality
More...
WL.* API
DEMO
ADAPTERS
Glue between your mobile app and stuff
Server-specific
Java or JavaScript (reminder...)
Setup via Studio or CLI
ADAPTERS - TYPES
HTTP
SQL
Cast Iron, Java, JMS, SAP JCo, SAP
CREATING ADAPTERS
mfpadapteradd//create
mfppush//pushanddeploychanges
mfpadaptercall//test
mfpadaptercalladapter/procedure'["arg"]'//passinganarg
DEMO
MORE STUFF
APPLICATION MESSAGES
MOBILE BROWSER
SIMULATOR

Cordova + Ionic + MobileFirst