Apache cordova or best called phonegap


"PhoneGap is a free and open source framework that allows you to create mobile apps using standardized web APIs for the platforms you care about." – http://phonegap.com

HOW to install it?


  1. You need install node.js first.
  2. Install PhoneGap's CLI via NPM, this way:
    $ [sudo] npm install -g phonegap
  3. Install Cordova's CLI:
    $ [sudo] npm install -g cordova

OUR FIRST HELLO WORLD APP


$ phonegap create hello com.example.hello HelloWorld
$ cd hello
$ phonegap run android

  1. "hello" is the folder where our first app is created.
  2. "com.example.hello" our app's identifer.
  3. "HelloWorld" our app's name.

INSIDE a new phonegap project


directory structure

INSIDE a new phonegap project


Entry point


JAVAscript


"JavaScript® (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions, most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic, is type safe, and supports object-oriented, imperative, and functional programming styles." – https://developer.mozilla.org

initialize it


PhoneGap starts our application via www/index.html, inside this HTML file some JavaScript files where added to initialize the PhoneGap's framework, also, to start our app when the device is ready. PhoneGap development is pretty much a web application with phone capabilities.

index.html

index.js

Prototypal Inheritance


"JavaScript has strong object-oriented programming capabilities, even though some debates have taken place due to the differences in object-oriented JavaScript compared to other languages." – https://developer.mozilla.org

Herencia prototipal, o, OOP ala JavaScript


"La herencia prototipal consiste en que un objeto es el prototipo de otro. La herencia en JavaScript es simple, es como una cadena, un objeto hereda de otro a través de un atributo que posee el objeto Object, el atributo es prototype. A prototype le podemos asignar cualquier cosa, simplemente que solo funciona cuando le asignamos un objeto, si tratamos de asignarle un primitivo, por ejemplo un número entero, JavaScript solo lo ignora. A esto se le denomina prototype chain" – http://juan.im

supported features


handling features


$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git

$ phonegap local plugin list
 
[phonegap] org.apache.cordova.core.console

$ phonegap local plugin remove org.apache.cordova.core.console

Customize Each Platform


You can customize your application via merges folder, this folder can handle custom stuff for each platform. This folder is a mirror from www folder, you don't need to do something inside platforms folder, basically they're regularly replaced with the top-level www directory's cross-platform source.



DEMO TIME!



QUESTIONS?

that's it!


@nebiros

juan.im

mail@juan.im

Apache Cordova or best called PhoneGap

By Juan Felipe Alvarez Saldarriaga

Apache Cordova or best called PhoneGap

An Apache Cordova / PhoneGap introduction.

  • 1,005