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

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

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