SlideShare una empresa de Scribd logo
1 de 26
Cordova: Using Your Web Skills
to Create Native Mobile Apps


                   Clay Ewing
Me?
• I teach here, at UM
  – Interactive MFA starting Fall 2013
• Web & Mobile Developer
• Game Designer
Cordova, aka PhoneGap
What is it?
• Framework for building mobile
  applications in HTML
• Allows access to native functions through
  JavaScript, like
  GPS, accelerometer, camera, etc.
  – http://docs.phonegap.com/en/2.3.0
Why Use It?
• Quick, no need to learn another
  language
• Cross platform compatible, minimal
  effort to make an app available on
  multiple mobile devices
• Open source
• Sell your app in a store
How does it work?
• Modern smart phone operating systems
  have their version of a webview
• Cordova is literally just a local web page
  seen through a full screen webview
• Plugins use device specific code
  (Objective C, Java, etc) to access
  functions through JavaScript
Plugins?
• A bunch of features are packed in
  automatically:
  – http://docs.phonegap.com/en/edge
• Community based plugins that focus on
  device OS specific stuff:
  – https://github.com/phonegap/phonegap-
    plugins
Let’s make an app!




http://www.github.com/claytical/magic8
Getting Started
• You need whatever IDE and SDK you
  would normally need.
  – iOS requires Xcode and the iOS SDK
    (https://developer.apple.com/)
  – Android requires Eclipse and the Android
    SDK (http://developer.android.com/sdk)
Look and Feel
• jQuery Mobile
  – http://jquerymobile.com
• Dojo
  – http://dojotoolkit.org
• Sencha Touch
  – http://www.sencha.com/products/touch
• iUI
  – http://www.iui-js.org/
Actually Getting Started
• Download the latest build
  – http://cordova.apache.org/#download
• Extract the zip file to wherever you want
  it
• Extract the zip file inside the zip file
  corresponding to the device you’re
  targeting
Unzipped iOS
Create the Project in Terminal
• For iOS, run:
  – bin/create <ProjectDirectory>
    <Namespace> <ProjectName>

  – bin/create
    “/Users/clay/Documents/CordovaExample”
    com.example.magic_8 Magic8
What the Command Creates




  Our focus:
A Little HTML
<h1>Magic 8 Ball</h1>
    <div id="asking">

          <textarea id="question" name="question" class="full" placeholder="To what
question do you seek the answer to?"></textarea>

         <button id="ask" class="gradient-button purple full">Ask</button>
      </div>

      <div id="answering" style="display:none">

        <div id="answer"></div>

        <button id="askagain" class="gradient-button purple full">Ask Again</button>
        <button id="newquestion" class="gradient-button purple full">New Q</button>
        <button id="share" class="gradient-button purple full">Share Results</button>
        <button id="tweet" class="gradient-button purple full">Tweet Results</button>

      </div>
Some CSS3 for Buttons
.gradient-button {
          display: inline-block;
          outline: none;
          cursor: pointer;
          text-align: center;
          text-decoration: none;
          font: 15px/100% Arial, Helvetica, sans-serif;
          padding: .5em 2em .55em;
          text-shadow: 0 1px 1px rgba(0,0,0,.3);
          -webkit-border-radius: .5em;
          border-radius: .5em;
          -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
          box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.gradient-button:active {
          position: relative;
          top: 1px;
}
Make a Purple Button
.purple {
       color: #fef4e9;
       border: solid 1px #551A8B;
       background: #8A2BE2;
       background: -webkit-gradient(linear, left top, left
bottom, from(#8A2BE2), to(#551A8B));
}

.purple:active {
       color: #fef4e9;
       background: -webkit-gradient(linear, left top, left
bottom, from(#551A8B), to(#694489));
}
The JavaScript
• Clean up index.js
  – It has some extra stuff we don’t need
• Add zepto.js for easy manipulation
  – You can use whatever framework you like
• Add social.js for our Social Framework
  Plugin
  – This is iOS specific
Some More JavaScript
var answers = ['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes –
definitely', 'You may rely on it', 'As I see it, yes', 'Most likely’];

       function getAnswer() {
         $('#asking').hide();
         $('#answering').show();
         var selectedResponse = Math.floor((Math.random()*20));
         $('#answer').text(answers[selectedResponse]);
       }

       function newQuestion() {
         $('#question').val("");
         $('#asking').show();
         $('#answering').hide();

       }
Plugins? No problem.
• Place the m and h files into the plugins
  folder

• Copy the js file into the www/js folder


• Add extra frameworks to the project

• Add a line to
    config.xml
Use the Plugin with JavaScript
function fbResults() {
         var qa = $('#question').val() + " " + $('#answer').text() + "
#magic8";
         SocialFrameworkPlugin.postToFacebook( shareSuccess,
shareError, qa);

}

function shareSuccess() {
   console.log("Sharing Successful");
 }

function shareError() {
   console.log("Error sharing");
}
Icons and Splash Screens
And Build.
Adobe PhoneGap Build
• Streamline the process of building for
  other platforms
• No need to own a mac to build an iOS
  app
• Free for open source projects
• Private repositories require a
  subscription
  – $12/month for 3 private apps
Adobe PhoneGap Build
Questions?



              Clay Ewing
       www.claytical.com
 www.github.com/claytical
     c.ewing@miami.edu
               @claytical

Más contenido relacionado

La actualidad más candente

jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptPhilipp Bosch
 
Deep dive into AngularJs for Beginners
Deep dive into AngularJs for BeginnersDeep dive into AngularJs for Beginners
Deep dive into AngularJs for BeginnersVassilis Pitsounis
 
Enterprising JavaFX
Enterprising JavaFXEnterprising JavaFX
Enterprising JavaFXRichard Bair
 
Joomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiencesJoomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiencesAndy_Gaskell
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileTerry Ryan
 
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery MobileTroy Miles
 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performancerobgalvinjr
 
An easy guide to Plugin Development
An easy guide to Plugin DevelopmentAn easy guide to Plugin Development
An easy guide to Plugin DevelopmentShinichi Nishikawa
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10Derek Jacoby
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4Derek Jacoby
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11Derek Jacoby
 
A Simple Plugin Architecture for Wicket
A Simple Plugin Architecture for WicketA Simple Plugin Architecture for Wicket
A Simple Plugin Architecture for Wicketnielsvk
 
Ember Conf 2016: Building Mobile Apps with Ember
Ember Conf 2016: Building Mobile Apps with EmberEmber Conf 2016: Building Mobile Apps with Ember
Ember Conf 2016: Building Mobile Apps with EmberAlex Blom
 
Build 2017 - B8002 - Introducing Adaptive Cards
Build 2017 - B8002 - Introducing Adaptive CardsBuild 2017 - B8002 - Introducing Adaptive Cards
Build 2017 - B8002 - Introducing Adaptive CardsWindows Developer
 
Configuration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL PluginConfiguration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL PluginDaniel Spilker
 

La actualidad más candente (20)

jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
 
Deep dive into AngularJs for Beginners
Deep dive into AngularJs for BeginnersDeep dive into AngularJs for Beginners
Deep dive into AngularJs for Beginners
 
Enterprising JavaFX
Enterprising JavaFXEnterprising JavaFX
Enterprising JavaFX
 
Joomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiencesJoomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiences
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery Mobile
 
Angular Classy
Angular ClassyAngular Classy
Angular Classy
 
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery Mobile
 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performance
 
An easy guide to Plugin Development
An easy guide to Plugin DevelopmentAn easy guide to Plugin Development
An easy guide to Plugin Development
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10
 
Untangling spring week4
Untangling spring week4Untangling spring week4
Untangling spring week4
 
Ember At Scale
Ember At ScaleEmber At Scale
Ember At Scale
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
 
A Simple Plugin Architecture for Wicket
A Simple Plugin Architecture for WicketA Simple Plugin Architecture for Wicket
A Simple Plugin Architecture for Wicket
 
Ember Conf 2016: Building Mobile Apps with Ember
Ember Conf 2016: Building Mobile Apps with EmberEmber Conf 2016: Building Mobile Apps with Ember
Ember Conf 2016: Building Mobile Apps with Ember
 
Untangling7
Untangling7Untangling7
Untangling7
 
Build 2017 - B8002 - Introducing Adaptive Cards
Build 2017 - B8002 - Introducing Adaptive CardsBuild 2017 - B8002 - Introducing Adaptive Cards
Build 2017 - B8002 - Introducing Adaptive Cards
 
Configuration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL PluginConfiguration as Code: The Job DSL Plugin
Configuration as Code: The Job DSL Plugin
 
Joomla REST API
Joomla REST APIJoomla REST API
Joomla REST API
 
Using Features
Using FeaturesUsing Features
Using Features
 

Similar a Cordova: Making Native Mobile Apps With Your Web Skills

Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMartinSotirov
 
Fake it 'til you make it
Fake it 'til you make itFake it 'til you make it
Fake it 'til you make itJonathan Snook
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegapRakesh Jha
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegapRakesh Jha
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseJen Looper
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)Bramus Van Damme
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers dssprakash
 
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript AppsBusy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript AppsJAX London
 
Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhoneBrian Shim
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptKevin Read
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Kevin Read
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevMihail Mateev
 
Responsive WordPress workflow
Responsive WordPress workflowResponsive WordPress workflow
Responsive WordPress workflowJames Bundey
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeRyan Boland
 
Ionic Framework - get up and running to build hybrid mobile apps
Ionic Framework - get up and running to build hybrid mobile appsIonic Framework - get up and running to build hybrid mobile apps
Ionic Framework - get up and running to build hybrid mobile appsAndreas Sahle
 
HoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsHoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsSarah Sexton
 

Similar a Cordova: Making Native Mobile Apps With Your Web Skills (20)

Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to Native
 
Fake it 'til you make it
Fake it 'til you make itFake it 'til you make it
Fake it 'til you make it
 
React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)
 
Adobe & HTML5
Adobe & HTML5Adobe & HTML5
Adobe & HTML5
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers
 
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript AppsBusy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
 
Eye candy for your iPhone
Eye candy for your iPhoneEye candy for your iPhone
Eye candy for your iPhone
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Node azure
Node azureNode azure
Node azure
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateev
 
Responsive WordPress workflow
Responsive WordPress workflowResponsive WordPress workflow
Responsive WordPress workflow
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
 
Ionic Framework - get up and running to build hybrid mobile apps
Ionic Framework - get up and running to build hybrid mobile appsIonic Framework - get up and running to build hybrid mobile apps
Ionic Framework - get up and running to build hybrid mobile apps
 
HoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOpsHoloLens Unity Build Pipelines on Azure DevOps
HoloLens Unity Build Pipelines on Azure DevOps
 

Más de Clay Ewing

Hypothesis Tested: Designing Games with Theoretical Frameworks
Hypothesis Tested: Designing Games with Theoretical FrameworksHypothesis Tested: Designing Games with Theoretical Frameworks
Hypothesis Tested: Designing Games with Theoretical FrameworksClay Ewing
 
Game Design Workshop for SEEDS at the University of Miami
Game Design Workshop for SEEDS at the University of MiamiGame Design Workshop for SEEDS at the University of Miami
Game Design Workshop for SEEDS at the University of MiamiClay Ewing
 
Getting Started with Queso
Getting Started with QuesoGetting Started with Queso
Getting Started with QuesoClay Ewing
 
Twine Workshop
Twine WorkshopTwine Workshop
Twine WorkshopClay Ewing
 
Win Win: Models for Creating a Social Impact Game on a Budget
Win Win: Models for Creating a Social Impact Game on a BudgetWin Win: Models for Creating a Social Impact Game on a Budget
Win Win: Models for Creating a Social Impact Game on a BudgetClay Ewing
 
Game Design dorkShop at LAB Miami
Game Design dorkShop at LAB MiamiGame Design dorkShop at LAB Miami
Game Design dorkShop at LAB MiamiClay Ewing
 
Defining games feedback
Defining games   feedbackDefining games   feedback
Defining games feedbackClay Ewing
 
CVJ531: Intro to MySQL
CVJ531: Intro to MySQLCVJ531: Intro to MySQL
CVJ531: Intro to MySQLClay Ewing
 
Welcome to CMP 394
Welcome to CMP 394Welcome to CMP 394
Welcome to CMP 394Clay Ewing
 

Más de Clay Ewing (9)

Hypothesis Tested: Designing Games with Theoretical Frameworks
Hypothesis Tested: Designing Games with Theoretical FrameworksHypothesis Tested: Designing Games with Theoretical Frameworks
Hypothesis Tested: Designing Games with Theoretical Frameworks
 
Game Design Workshop for SEEDS at the University of Miami
Game Design Workshop for SEEDS at the University of MiamiGame Design Workshop for SEEDS at the University of Miami
Game Design Workshop for SEEDS at the University of Miami
 
Getting Started with Queso
Getting Started with QuesoGetting Started with Queso
Getting Started with Queso
 
Twine Workshop
Twine WorkshopTwine Workshop
Twine Workshop
 
Win Win: Models for Creating a Social Impact Game on a Budget
Win Win: Models for Creating a Social Impact Game on a BudgetWin Win: Models for Creating a Social Impact Game on a Budget
Win Win: Models for Creating a Social Impact Game on a Budget
 
Game Design dorkShop at LAB Miami
Game Design dorkShop at LAB MiamiGame Design dorkShop at LAB Miami
Game Design dorkShop at LAB Miami
 
Defining games feedback
Defining games   feedbackDefining games   feedback
Defining games feedback
 
CVJ531: Intro to MySQL
CVJ531: Intro to MySQLCVJ531: Intro to MySQL
CVJ531: Intro to MySQL
 
Welcome to CMP 394
Welcome to CMP 394Welcome to CMP 394
Welcome to CMP 394
 

Último

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 

Último (20)

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 

Cordova: Making Native Mobile Apps With Your Web Skills

  • 1. Cordova: Using Your Web Skills to Create Native Mobile Apps Clay Ewing
  • 2. Me? • I teach here, at UM – Interactive MFA starting Fall 2013 • Web & Mobile Developer • Game Designer
  • 4. What is it? • Framework for building mobile applications in HTML • Allows access to native functions through JavaScript, like GPS, accelerometer, camera, etc. – http://docs.phonegap.com/en/2.3.0
  • 5. Why Use It? • Quick, no need to learn another language • Cross platform compatible, minimal effort to make an app available on multiple mobile devices • Open source • Sell your app in a store
  • 6. How does it work? • Modern smart phone operating systems have their version of a webview • Cordova is literally just a local web page seen through a full screen webview • Plugins use device specific code (Objective C, Java, etc) to access functions through JavaScript
  • 7. Plugins? • A bunch of features are packed in automatically: – http://docs.phonegap.com/en/edge • Community based plugins that focus on device OS specific stuff: – https://github.com/phonegap/phonegap- plugins
  • 8. Let’s make an app! http://www.github.com/claytical/magic8
  • 9. Getting Started • You need whatever IDE and SDK you would normally need. – iOS requires Xcode and the iOS SDK (https://developer.apple.com/) – Android requires Eclipse and the Android SDK (http://developer.android.com/sdk)
  • 10. Look and Feel • jQuery Mobile – http://jquerymobile.com • Dojo – http://dojotoolkit.org • Sencha Touch – http://www.sencha.com/products/touch • iUI – http://www.iui-js.org/
  • 11. Actually Getting Started • Download the latest build – http://cordova.apache.org/#download • Extract the zip file to wherever you want it • Extract the zip file inside the zip file corresponding to the device you’re targeting
  • 13. Create the Project in Terminal • For iOS, run: – bin/create <ProjectDirectory> <Namespace> <ProjectName> – bin/create “/Users/clay/Documents/CordovaExample” com.example.magic_8 Magic8
  • 14. What the Command Creates Our focus:
  • 15. A Little HTML <h1>Magic 8 Ball</h1> <div id="asking"> <textarea id="question" name="question" class="full" placeholder="To what question do you seek the answer to?"></textarea> <button id="ask" class="gradient-button purple full">Ask</button> </div> <div id="answering" style="display:none"> <div id="answer"></div> <button id="askagain" class="gradient-button purple full">Ask Again</button> <button id="newquestion" class="gradient-button purple full">New Q</button> <button id="share" class="gradient-button purple full">Share Results</button> <button id="tweet" class="gradient-button purple full">Tweet Results</button> </div>
  • 16. Some CSS3 for Buttons .gradient-button { display: inline-block; outline: none; cursor: pointer; text-align: center; text-decoration: none; font: 15px/100% Arial, Helvetica, sans-serif; padding: .5em 2em .55em; text-shadow: 0 1px 1px rgba(0,0,0,.3); -webkit-border-radius: .5em; border-radius: .5em; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2); box-shadow: 0 1px 2px rgba(0,0,0,.2); } .gradient-button:active { position: relative; top: 1px; }
  • 17. Make a Purple Button .purple { color: #fef4e9; border: solid 1px #551A8B; background: #8A2BE2; background: -webkit-gradient(linear, left top, left bottom, from(#8A2BE2), to(#551A8B)); } .purple:active { color: #fef4e9; background: -webkit-gradient(linear, left top, left bottom, from(#551A8B), to(#694489)); }
  • 18. The JavaScript • Clean up index.js – It has some extra stuff we don’t need • Add zepto.js for easy manipulation – You can use whatever framework you like • Add social.js for our Social Framework Plugin – This is iOS specific
  • 19. Some More JavaScript var answers = ['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes – definitely', 'You may rely on it', 'As I see it, yes', 'Most likely’]; function getAnswer() { $('#asking').hide(); $('#answering').show(); var selectedResponse = Math.floor((Math.random()*20)); $('#answer').text(answers[selectedResponse]); } function newQuestion() { $('#question').val(""); $('#asking').show(); $('#answering').hide(); }
  • 20. Plugins? No problem. • Place the m and h files into the plugins folder • Copy the js file into the www/js folder • Add extra frameworks to the project • Add a line to config.xml
  • 21. Use the Plugin with JavaScript function fbResults() { var qa = $('#question').val() + " " + $('#answer').text() + " #magic8"; SocialFrameworkPlugin.postToFacebook( shareSuccess, shareError, qa); } function shareSuccess() { console.log("Sharing Successful"); } function shareError() { console.log("Error sharing"); }
  • 22. Icons and Splash Screens
  • 24. Adobe PhoneGap Build • Streamline the process of building for other platforms • No need to own a mac to build an iOS app • Free for open source projects • Private repositories require a subscription – $12/month for 3 private apps
  • 26. Questions? Clay Ewing www.claytical.com www.github.com/claytical c.ewing@miami.edu @claytical