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?
- You need install node.js first.
- Install PhoneGap's CLI via NPM, this way:
$ [sudo] npm install -g phonegap - 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
- "hello" is the folder where our first app is created.
- "com.example.hello" our app's identifer.
- "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
- Basic device information (Device API).
- Network Connection and Battery Events.
- Accelerometer, Compass, and Geolocation.
- Camera, Media playback and Capture.
- Access files on device or network (File API).
- Notification via dialog box or vibration.
- Contacts.
- Globalization.
- Splashscreen.
- Open new browser windows (InAppBrowser).
- Debug console.
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!
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