SlideShare a Scribd company logo
* 
* 
* Who Am I?
* What is Cordova?
* What are Hooks?
* What are Hooks written in?
* What problems do they solve?
* What Hooks do I use?
* Demo – Hooks in Action
* Q&A
* Resources
* 
* Gavin Pickin – developing Web Apps since late 90s
* What else do you need to know?
* Blog - http://www.gpickin.com
* Twitter – http://twitter.com/gpickin
* Lets get on with the show.
* 
* Apache Cordova is a set of device APIs that allow a
mobile app developer to access native device
function such as the camera or accelerometer from
JavaScript.
* Combined with a UI framework such as jQuery
Mobile or Dojo Mobile or Sencha Touch, this allows
a smartphone app to be developed with just HTML,
CSS, and JavaScript.
* http://cordova.apache.org/#about
* 
* And because these JavaScript APIs are consistent
across multiple device platforms and built on web
standards, the app should be portable to other
device platforms with minimal to no changes.
* In 2011 Adobe / Nitobi donated the phonegap
codebase to Apache Software Foundation to be
managed as an Opensource project. It was
eventually renamed Cordova.
* http://phonegap.com/2012/03/19/phonegap-cordova-
and-what%E2%80%99s-in-a-name/
* 
* Cordova includes a CLI that runs on NodeJS, to
help you compile your project for different
deployment platforms.
* Phonegap Build is one service that allows you to
build Apps without system dependent tools like
Xcode (iOS)
* 
* Hooks are scripts that execute when special events
are emitted from the plugin, or build process.
* There are a lot of hooks you can use, below is a
sample
* after_build / before_build
* After_platform_add / before_platform_add
* After_prepare / before_prepare
* A full list of hooks can be found here
https://github.com/apache/cordova-lib/blob/master/
cordova-lib/templates/hooks-README.md
* 
* Developing for multiple platforms is easier with
Cordova, but there are a lot of repetitive tasks, or
build steps that you can automate
* Using Hooks you can simply build your own Build
Process using the framework provided to you.
* They can make you a more efficient developer.
* 
* Hooks can be written in any programming language
* BUT – Cordova highly recommends writing hooks in
NodeJS to ensure the hook are cross platform.
Since the Cordova CLI is written in NodeJS, they
will always work.
* Since your hooks will be NodeJS, you can use the
power of NPM to help yu write them.
* 
* The most common way is to place the script in
the /hooks/{event_name}/ folder
* Files are executed in their alphabetical order.
Since Windows and *nix systems treat aG and ag
differently, I recommend prefixing with 001_ etc.
* You can also define Application hooks in config.xml
* You can define Plugin hooks from
/plugins/…/plugin.xml
* 
<hook type="before_build" src="scripts/appBeforeBuild.bat" />
<hook type="before_build" src="scripts/appBeforeBuild.js" />
<hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" />
<platform name="wp8">
<hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.bat" />
<hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.js" />
<hook type="before_plugin_install" src="scripts/wp8/appWP8BeforePluginInstall.js" />
</platform>
<platform name="windows8">
<hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.bat" />
<hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.js" />
<hook type="before_plugin_install" src="scripts/windows8/
appWin8BeforePluginInstall.js" />
</platform>
https://github.com/apache/cordova-lib/blob/master/cordova-lib/templates/hooks-README.md
* 
<hook type="before_plugin_install" src="scripts/beforeInstall.js" />
<hook type="after_build" src="scripts/afterBuild.js" />
<platform name="wp8">
<hook type="before_plugin_install" src="scripts/
wp8BeforeInstall.js" />
<hook type="before_build" src="scripts/wp8BeforeBuild.js" />
</platform>
* 
* Being new to NodeJS most of the hooks I use
currently are ones I have found online… with minor
tweaks.
* JS Hint Hook
* Cordova Uglify
* Work In Progress
* Jasmine for Unit Testing
* Hook for Splash and Icon Creation
* 
* JSHint is a community-driven tool to detect errors
and potential problems in JavaScript code and to
enforce your team's coding conventions. It is very
flexible so you can easily adjust it to your
particular coding guidelines and the environment
you expect your code to execute in. JSHint is open
source and will always stay this way.
* http://jshint.com/about/
* Hook - https://gist.github.com/gpickin/
04a7acfc4907f3ed27f6
* 
* Cordova hook that allows you to uglify or minify
your apps JavaScript and CSS. It is using UglifyJS2
for JavaScript compression and clean-css to minify
CSS.
* Install from NPM - npm install cordova-uglify
* https://github.com/rossmartin/cordova-uglify
* Hook - https://gist.github.com/gpickin/
f23a4980b5359ba570b1
* 
* Let me show you how the JS Hint Hook will help
save you time testing an app on a device with
errors in your code.
https://gist.github.com/gpickin/04a7acfc4907f3ed27f6
* Let me show you how to use Cordova Uglify Hook
for when your building to send to the app store.
https://gist.github.com/gpickin/f23a4980b5359ba570b1
* 
$ cordova build ios
Running command: /Users/gavinpickin/Dropbox/Apps/cstctraining/hooks/
before_prepare/02_jshint.js /Users/gavinpickin/Dropbox/Apps/cstctraining
Linting www/js/services/attendeeDAO.js
Linting www/js/index.js
File www/js/services/attendeeDAO.js has no errors.
-----------------------------------------
Linting www/js/services/attendeeService.js
File www/js/index.js has no errors.
-----------------------------------------
File www/js/services/attendeeService.js has no errors.
-----------------------------------------
Linting www/js/services/attendeeSyncService.js
File www/js/services/attendeeSyncService.js has no errors.
-----------------------------------------
Linting www/js/services/auditDAO.js
File www/js/services/auditDAO.js has no errors.
* 
$ cordova build ios
Running command: /Users/gavinpickin/Dropbox/Apps/cstctraining/hooks/
before_prepare/02_jshint.js /Users/gavinpickin/Dropbox/Apps/cstctraining
Linting www/js/services/attendeeDAO.js
Linting www/js/index.js
Errors in file www/js/services/attendeeDAO.js
1:1 -> Expected an assignment or function call and instead saw an expression. ->
funct ion newAttendeeDAO() {
1:6 -> Missing semicolon. -> funct ion newAttendeeDAO() {
1:7 -> Expected an assignment or function call and instead saw an expression. ->
funct ion newAttendeeDAO() {
1:10 -> Missing semicolon. -> funct ion newAttendeeDAO() {
1:27 -> Missing semicolon. -> funct ion newAttendeeDAO() {
-----------------------------------------
File www/js/index.js has no errors.
* 
Running command: /Users/gavinpickin/Dropbox/Apps/cstctraining/hooks/
after_prepare/uglify.js /Users/gavinpickin/Dropbox/Apps/cstctraining
cordova-uglify will always run by default, uncomment the line checking for the
release flag otherwise
uglifying js file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/
www/js/index.js
minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/
www/css/index.css
minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/
www/css/jquery.mobile-1.4.2.min.css
minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/
www/css/jquery.mobile.external-png-1.4.2.min.css
minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/
www/css/jquery.mobile.icons-1.4.2.min.css
encountered a .png file, not compressing it
encountered a .svg file, not compressing it
* 
* Any questions?
* Any recommendations for improving this talk?
* 
* Copy Icons / Splashscreens, Replace Text
Depending on Environment, Add Plugins
Source: Holly Schinsky – DevGirl – Adobe Evangelist
http://devgirl.org/2013/11/12/three-hooks-your-
cordovaphonegap-project-needs/
* JS Hint, Cordova Uglify
Source: Nic Raboy
http://ionicframework.com/blog/minifying-your-source-code/
* Dan Moore - Hooks and Cordova
http://www.mooreds.com/wordpress/archives/1197

More Related Content

What's hot

DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
BalaBit
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
Riccardo Coppola
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentTakayuki Miyauchi
 
Cross-platform Desktop application with AngularJS and build with Node-webkit
Cross-platform Desktop application with AngularJS and build with Node-webkitCross-platform Desktop application with AngularJS and build with Node-webkit
Cross-platform Desktop application with AngularJS and build with Node-webkit
Wittawas Wisarnkanchana
 
Webpack: from 0 to 2
Webpack: from 0 to 2Webpack: from 0 to 2
Webpack: from 0 to 2
Alessandro Bellini
 
node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!
욱진 양
 
Hack Rio/OS
Hack Rio/OSHack Rio/OS
Hack Rio/OS
Kishore Neelamegam
 
Node.js with Express
Node.js with ExpressNode.js with Express
Node.js with Express
Gergely Németh
 
Node js
Node jsNode js
Spring IO '15 - Developing microservices, Spring Boot or Grails?
Spring IO '15 - Developing microservices, Spring Boot or Grails?Spring IO '15 - Developing microservices, Spring Boot or Grails?
Spring IO '15 - Developing microservices, Spring Boot or Grails?
Fátima Casaú Pérez
 
Getting started with .net on openSUSE (asp.net with c#)
Getting started with .net on openSUSE  (asp.net with c#)Getting started with .net on openSUSE  (asp.net with c#)
Getting started with .net on openSUSE (asp.net with c#)
Alin Alifah
 
HTML5 for dummies
HTML5 for dummiesHTML5 for dummies
HTML5 for dummies
Ran Bar-Zik
 
Introduction to Express and Grunt
Introduction to Express and GruntIntroduction to Express and Grunt
Introduction to Express and Grunt
Peter deHaan
 
React Native Expo
React Native ExpoReact Native Expo
React Native Expo
Ryosuke Hara
 
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
🎤 Hanno Embregts 🎸
 
WebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreWebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET Core
Chen Yu Pao
 
Web pack and friends
Web pack and friendsWeb pack and friends
Web pack and friends
Matthias Hryniszak
 
Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)
Saif Jerbi
 
ITB2019 CommandBox vs Node.js - Nolan Erck
ITB2019  CommandBox vs Node.js - Nolan ErckITB2019  CommandBox vs Node.js - Nolan Erck
ITB2019 CommandBox vs Node.js - Nolan Erck
Ortus Solutions, Corp
 

What's hot (19)

DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
VCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment
 
Cross-platform Desktop application with AngularJS and build with Node-webkit
Cross-platform Desktop application with AngularJS and build with Node-webkitCross-platform Desktop application with AngularJS and build with Node-webkit
Cross-platform Desktop application with AngularJS and build with Node-webkit
 
Webpack: from 0 to 2
Webpack: from 0 to 2Webpack: from 0 to 2
Webpack: from 0 to 2
 
node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!node-webkit : Make a magic from your a desktop app to desktop app!
node-webkit : Make a magic from your a desktop app to desktop app!
 
Hack Rio/OS
Hack Rio/OSHack Rio/OS
Hack Rio/OS
 
Node.js with Express
Node.js with ExpressNode.js with Express
Node.js with Express
 
Node js
Node jsNode js
Node js
 
Spring IO '15 - Developing microservices, Spring Boot or Grails?
Spring IO '15 - Developing microservices, Spring Boot or Grails?Spring IO '15 - Developing microservices, Spring Boot or Grails?
Spring IO '15 - Developing microservices, Spring Boot or Grails?
 
Getting started with .net on openSUSE (asp.net with c#)
Getting started with .net on openSUSE  (asp.net with c#)Getting started with .net on openSUSE  (asp.net with c#)
Getting started with .net on openSUSE (asp.net with c#)
 
HTML5 for dummies
HTML5 for dummiesHTML5 for dummies
HTML5 for dummies
 
Introduction to Express and Grunt
Introduction to Express and GruntIntroduction to Express and Grunt
Introduction to Express and Grunt
 
React Native Expo
React Native ExpoReact Native Expo
React Native Expo
 
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
"Will Git Be Around Forever? A List of Possible Successors" at UtrechtJUG
 
WebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET CoreWebSocket on client & server using websocket-sharp & ASP.NET Core
WebSocket on client & server using websocket-sharp & ASP.NET Core
 
Web pack and friends
Web pack and friendsWeb pack and friends
Web pack and friends
 
Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)
 
ITB2019 CommandBox vs Node.js - Nolan Erck
ITB2019  CommandBox vs Node.js - Nolan ErckITB2019  CommandBox vs Node.js - Nolan Erck
ITB2019 CommandBox vs Node.js - Nolan Erck
 

Viewers also liked

Fr sponsor talk may 2015
Fr sponsor talk may 2015Fr sponsor talk may 2015
Fr sponsor talk may 2015
ColdFusionConference
 
Relationships are hard
Relationships are hardRelationships are hard
Relationships are hard
ColdFusionConference
 
Refactor Large applications with Backbone
Refactor Large applications with BackboneRefactor Large applications with Backbone
Refactor Large applications with Backbone
ColdFusionConference
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
ColdFusionConference
 
Command box
Command boxCommand box
Garbage First & You
Garbage First & YouGarbage First & You
Garbage First & You
ColdFusionConference
 
Building Multi-Tenant Saas Apps
Building  Multi-Tenant Saas AppsBuilding  Multi-Tenant Saas Apps
Building Multi-Tenant Saas Apps
ColdFusionConference
 
API Management from the Trenches
API Management from the TrenchesAPI Management from the Trenches
API Management from the Trenches
ColdFusionConference
 
Who Owns Software Security?
Who Owns Software Security?Who Owns Software Security?
Who Owns Software Security?
ColdFusionConference
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
ColdFusionConference
 
2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd
ColdFusionConference
 
Effective version control
Effective version controlEffective version control
Effective version control
ColdFusionConference
 
Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
ColdFusionConference
 
This is how we REST
This is how we RESTThis is how we REST
This is how we REST
ColdFusionConference
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web Components
ColdFusionConference
 
Dev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slidesDev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slides
ColdFusionConference
 
I am-designer
I am-designerI am-designer
I am-designer
ColdFusionConference
 
Get Gulping with Javascript Task Runners
Get Gulping with Javascript Task RunnersGet Gulping with Javascript Task Runners
Get Gulping with Javascript Task Runners
ColdFusionConference
 

Viewers also liked (20)

Fr sponsor talk may 2015
Fr sponsor talk may 2015Fr sponsor talk may 2015
Fr sponsor talk may 2015
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
 
Relationships are hard
Relationships are hardRelationships are hard
Relationships are hard
 
Refactor Large applications with Backbone
Refactor Large applications with BackboneRefactor Large applications with Backbone
Refactor Large applications with Backbone
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
 
Command box
Command boxCommand box
Command box
 
Garbage First & You
Garbage First & YouGarbage First & You
Garbage First & You
 
Marketing for developers
Marketing for developersMarketing for developers
Marketing for developers
 
Building Multi-Tenant Saas Apps
Building  Multi-Tenant Saas AppsBuilding  Multi-Tenant Saas Apps
Building Multi-Tenant Saas Apps
 
API Management from the Trenches
API Management from the TrenchesAPI Management from the Trenches
API Management from the Trenches
 
Who Owns Software Security?
Who Owns Software Security?Who Owns Software Security?
Who Owns Software Security?
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd
 
Effective version control
Effective version controlEffective version control
Effective version control
 
Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
 
This is how we REST
This is how we RESTThis is how we REST
This is how we REST
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web Components
 
Dev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slidesDev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slides
 
I am-designer
I am-designerI am-designer
I am-designer
 
Get Gulping with Javascript Task Runners
Get Gulping with Javascript Task RunnersGet Gulping with Javascript Task Runners
Get Gulping with Javascript Task Runners
 

Similar to Getting Your Hooks into Cordova

GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
Srinadh Kanugala
 
Angularjs Tutorial for Beginners
Angularjs Tutorial for BeginnersAngularjs Tutorial for Beginners
Angularjs Tutorial for Beginners
rajkamaltibacademy
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
Bogusz Jelinski
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
John M. Wargo
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript
Serge van den Oever
 
Tutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJSTutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJS
Philipp Burgmer
 
Cordova iOS Native Plugin Development
Cordova iOS Native Plugin DevelopmentCordova iOS Native Plugin Development
Cordova iOS Native Plugin Development
Josue Bustos
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
leffen
 
Workshop on Hybrid App Development with Ionic Framework
Workshop on Hybrid App Development with Ionic FrameworkWorkshop on Hybrid App Development with Ionic Framework
Workshop on Hybrid App Development with Ionic Framework
Aayush Shrestha
 
Hybrid app development frameworks
Hybrid app development frameworksHybrid app development frameworks
Hybrid app development frameworks
Squash Apps Pvt Ltd
 
Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!
Milindu Sanoj Kumarage
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
Justin James
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲益祥 許
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
Mando Stam
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
Sargis Sargsyan
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
Kirill Kounik
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
Ramesh Nair
 

Similar to Getting Your Hooks into Cordova (20)

GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
 
Angularjs Tutorial for Beginners
Angularjs Tutorial for BeginnersAngularjs Tutorial for Beginners
Angularjs Tutorial for Beginners
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
 
OpenMIC March-2012.phonegap
OpenMIC March-2012.phonegapOpenMIC March-2012.phonegap
OpenMIC March-2012.phonegap
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript
 
Tutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJSTutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJS
 
Cordova iOS Native Plugin Development
Cordova iOS Native Plugin DevelopmentCordova iOS Native Plugin Development
Cordova iOS Native Plugin Development
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Workshop on Hybrid App Development with Ionic Framework
Workshop on Hybrid App Development with Ionic FrameworkWorkshop on Hybrid App Development with Ionic Framework
Workshop on Hybrid App Development with Ionic Framework
 
Hybrid app development frameworks
Hybrid app development frameworksHybrid app development frameworks
Hybrid app development frameworks
 
Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲
 
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
GDG-ANDROID-ATHENS Meetup: Build in Docker with Jenkins
 
Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019Run your Appium tests using Docker Android - AppiumConf 2019
Run your Appium tests using Docker Android - AppiumConf 2019
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 

More from ColdFusionConference

Api manager preconference
Api manager preconferenceApi manager preconference
Api manager preconference
ColdFusionConference
 
Cf ppt vsr
Cf ppt vsrCf ppt vsr
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
ColdFusionConference
 
API Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIsAPI Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIs
ColdFusionConference
 
Don't just pdf, Smart PDF
Don't just pdf, Smart PDFDon't just pdf, Smart PDF
Don't just pdf, Smart PDF
ColdFusionConference
 
Crafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an ArchitectCrafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an Architect
ColdFusionConference
 
Security And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API ManagerSecurity And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API Manager
ColdFusionConference
 
Monetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APISMonetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APIS
ColdFusionConference
 
Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016
ColdFusionConference
 
ColdFusion in Transit action
ColdFusion in Transit actionColdFusion in Transit action
ColdFusion in Transit action
ColdFusionConference
 
Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016
ColdFusionConference
 
Where is cold fusion headed
Where is cold fusion headedWhere is cold fusion headed
Where is cold fusion headed
ColdFusionConference
 
ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusionConference
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
ColdFusionConference
 
Restful services with ColdFusion
Restful services with ColdFusionRestful services with ColdFusion
Restful services with ColdFusion
ColdFusionConference
 
Super Fast Application development with Mura CMS
Super Fast Application development with Mura CMSSuper Fast Application development with Mura CMS
Super Fast Application development with Mura CMS
ColdFusionConference
 
Build your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and webBuild your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and web
ColdFusionConference
 
Why Everyone else writes bad code
Why Everyone else writes bad codeWhy Everyone else writes bad code
Why Everyone else writes bad code
ColdFusionConference
 
Securing applications
Securing applicationsSecuring applications
Securing applications
ColdFusionConference
 
Testing automaton
Testing automatonTesting automaton
Testing automaton
ColdFusionConference
 

More from ColdFusionConference (20)

Api manager preconference
Api manager preconferenceApi manager preconference
Api manager preconference
 
Cf ppt vsr
Cf ppt vsrCf ppt vsr
Cf ppt vsr
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
API Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIsAPI Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIs
 
Don't just pdf, Smart PDF
Don't just pdf, Smart PDFDon't just pdf, Smart PDF
Don't just pdf, Smart PDF
 
Crafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an ArchitectCrafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an Architect
 
Security And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API ManagerSecurity And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API Manager
 
Monetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APISMonetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APIS
 
Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016
 
ColdFusion in Transit action
ColdFusion in Transit actionColdFusion in Transit action
ColdFusion in Transit action
 
Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016
 
Where is cold fusion headed
Where is cold fusion headedWhere is cold fusion headed
Where is cold fusion headed
 
ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
 
Restful services with ColdFusion
Restful services with ColdFusionRestful services with ColdFusion
Restful services with ColdFusion
 
Super Fast Application development with Mura CMS
Super Fast Application development with Mura CMSSuper Fast Application development with Mura CMS
Super Fast Application development with Mura CMS
 
Build your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and webBuild your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and web
 
Why Everyone else writes bad code
Why Everyone else writes bad codeWhy Everyone else writes bad code
Why Everyone else writes bad code
 
Securing applications
Securing applicationsSecuring applications
Securing applications
 
Testing automaton
Testing automatonTesting automaton
Testing automaton
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 

Getting Your Hooks into Cordova

  • 2. *  * Who Am I? * What is Cordova? * What are Hooks? * What are Hooks written in? * What problems do they solve? * What Hooks do I use? * Demo – Hooks in Action * Q&A * Resources
  • 3. *  * Gavin Pickin – developing Web Apps since late 90s * What else do you need to know? * Blog - http://www.gpickin.com * Twitter – http://twitter.com/gpickin * Lets get on with the show.
  • 4. *  * Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. * Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript. * http://cordova.apache.org/#about
  • 5. *  * And because these JavaScript APIs are consistent across multiple device platforms and built on web standards, the app should be portable to other device platforms with minimal to no changes. * In 2011 Adobe / Nitobi donated the phonegap codebase to Apache Software Foundation to be managed as an Opensource project. It was eventually renamed Cordova. * http://phonegap.com/2012/03/19/phonegap-cordova- and-what%E2%80%99s-in-a-name/
  • 6. *  * Cordova includes a CLI that runs on NodeJS, to help you compile your project for different deployment platforms. * Phonegap Build is one service that allows you to build Apps without system dependent tools like Xcode (iOS)
  • 7. *  * Hooks are scripts that execute when special events are emitted from the plugin, or build process. * There are a lot of hooks you can use, below is a sample * after_build / before_build * After_platform_add / before_platform_add * After_prepare / before_prepare * A full list of hooks can be found here https://github.com/apache/cordova-lib/blob/master/ cordova-lib/templates/hooks-README.md
  • 8. *  * Developing for multiple platforms is easier with Cordova, but there are a lot of repetitive tasks, or build steps that you can automate * Using Hooks you can simply build your own Build Process using the framework provided to you. * They can make you a more efficient developer.
  • 9. *  * Hooks can be written in any programming language * BUT – Cordova highly recommends writing hooks in NodeJS to ensure the hook are cross platform. Since the Cordova CLI is written in NodeJS, they will always work. * Since your hooks will be NodeJS, you can use the power of NPM to help yu write them.
  • 10. *  * The most common way is to place the script in the /hooks/{event_name}/ folder * Files are executed in their alphabetical order. Since Windows and *nix systems treat aG and ag differently, I recommend prefixing with 001_ etc. * You can also define Application hooks in config.xml * You can define Plugin hooks from /plugins/…/plugin.xml
  • 11. *  <hook type="before_build" src="scripts/appBeforeBuild.bat" /> <hook type="before_build" src="scripts/appBeforeBuild.js" /> <hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" /> <platform name="wp8"> <hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.bat" /> <hook type="before_build" src="scripts/wp8/appWP8BeforeBuild.js" /> <hook type="before_plugin_install" src="scripts/wp8/appWP8BeforePluginInstall.js" /> </platform> <platform name="windows8"> <hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.bat" /> <hook type="before_build" src="scripts/windows8/appWin8BeforeBuild.js" /> <hook type="before_plugin_install" src="scripts/windows8/ appWin8BeforePluginInstall.js" /> </platform> https://github.com/apache/cordova-lib/blob/master/cordova-lib/templates/hooks-README.md
  • 12. *  <hook type="before_plugin_install" src="scripts/beforeInstall.js" /> <hook type="after_build" src="scripts/afterBuild.js" /> <platform name="wp8"> <hook type="before_plugin_install" src="scripts/ wp8BeforeInstall.js" /> <hook type="before_build" src="scripts/wp8BeforeBuild.js" /> </platform>
  • 13. *  * Being new to NodeJS most of the hooks I use currently are ones I have found online… with minor tweaks. * JS Hint Hook * Cordova Uglify * Work In Progress * Jasmine for Unit Testing * Hook for Splash and Icon Creation
  • 14. *  * JSHint is a community-driven tool to detect errors and potential problems in JavaScript code and to enforce your team's coding conventions. It is very flexible so you can easily adjust it to your particular coding guidelines and the environment you expect your code to execute in. JSHint is open source and will always stay this way. * http://jshint.com/about/ * Hook - https://gist.github.com/gpickin/ 04a7acfc4907f3ed27f6
  • 15. *  * Cordova hook that allows you to uglify or minify your apps JavaScript and CSS. It is using UglifyJS2 for JavaScript compression and clean-css to minify CSS. * Install from NPM - npm install cordova-uglify * https://github.com/rossmartin/cordova-uglify * Hook - https://gist.github.com/gpickin/ f23a4980b5359ba570b1
  • 16. *  * Let me show you how the JS Hint Hook will help save you time testing an app on a device with errors in your code. https://gist.github.com/gpickin/04a7acfc4907f3ed27f6 * Let me show you how to use Cordova Uglify Hook for when your building to send to the app store. https://gist.github.com/gpickin/f23a4980b5359ba570b1
  • 17. *  $ cordova build ios Running command: /Users/gavinpickin/Dropbox/Apps/cstctraining/hooks/ before_prepare/02_jshint.js /Users/gavinpickin/Dropbox/Apps/cstctraining Linting www/js/services/attendeeDAO.js Linting www/js/index.js File www/js/services/attendeeDAO.js has no errors. ----------------------------------------- Linting www/js/services/attendeeService.js File www/js/index.js has no errors. ----------------------------------------- File www/js/services/attendeeService.js has no errors. ----------------------------------------- Linting www/js/services/attendeeSyncService.js File www/js/services/attendeeSyncService.js has no errors. ----------------------------------------- Linting www/js/services/auditDAO.js File www/js/services/auditDAO.js has no errors.
  • 18. *  $ cordova build ios Running command: /Users/gavinpickin/Dropbox/Apps/cstctraining/hooks/ before_prepare/02_jshint.js /Users/gavinpickin/Dropbox/Apps/cstctraining Linting www/js/services/attendeeDAO.js Linting www/js/index.js Errors in file www/js/services/attendeeDAO.js 1:1 -> Expected an assignment or function call and instead saw an expression. -> funct ion newAttendeeDAO() { 1:6 -> Missing semicolon. -> funct ion newAttendeeDAO() { 1:7 -> Expected an assignment or function call and instead saw an expression. -> funct ion newAttendeeDAO() { 1:10 -> Missing semicolon. -> funct ion newAttendeeDAO() { 1:27 -> Missing semicolon. -> funct ion newAttendeeDAO() { ----------------------------------------- File www/js/index.js has no errors.
  • 19. *  Running command: /Users/gavinpickin/Dropbox/Apps/cstctraining/hooks/ after_prepare/uglify.js /Users/gavinpickin/Dropbox/Apps/cstctraining cordova-uglify will always run by default, uncomment the line checking for the release flag otherwise uglifying js file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/ www/js/index.js minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/ www/css/index.css minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/ www/css/jquery.mobile-1.4.2.min.css minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/ www/css/jquery.mobile.external-png-1.4.2.min.css minifying css file /Users/gavinpickin/Dropbox/Apps/cstctraining/platforms/ios/ www/css/jquery.mobile.icons-1.4.2.min.css encountered a .png file, not compressing it encountered a .svg file, not compressing it
  • 21. *  * Copy Icons / Splashscreens, Replace Text Depending on Environment, Add Plugins Source: Holly Schinsky – DevGirl – Adobe Evangelist http://devgirl.org/2013/11/12/three-hooks-your- cordovaphonegap-project-needs/ * JS Hint, Cordova Uglify Source: Nic Raboy http://ionicframework.com/blog/minifying-your-source-code/ * Dan Moore - Hooks and Cordova http://www.mooreds.com/wordpress/archives/1197