Created by Carlos Santana / @csantanapr
"musician" : false,
"company": "IBM",
"careers" : [
"Server Engineer",
"Mobile Developer",
"Open Source Committer",
"MobileFirst Architect"
],
"dependencies": {
"Family": "~1.0",
"Gadgets": "~0.1",
"Software": "~0.2"
},
"ethnicity": "geek",
"languages": ["spanish","english","javascript"],
"loves what it does": true,
"In 5 years": "function () { [native code] }"
Demo (UX)
“So you want to build a native app?”
Mobile devices and web views have rapidly improved!
Open Source Project for Hybrid Development
(You'll feel right at home)
getPicture: function(){
navigator.camera.getPicture(
app.onSucessCamera,
app.onFailCamera,
{
quality: 50,
destinationType: Camera.DestinationType.FILE_URI
});
}
onSucessCamera: function(imageURI) {
var image = document.getElementById('myImage');
image.src = imageURI;
},
onFailCamera: function(message) {
alert('Failed because: ' + message);
},
Demo Apache Cordova CLI and Camera Plugin
npm install -g cordova
$cordova help
$ cordova create jsmeetup com.example.jsmeetup trianglejs
Creating a new cordova project with name "jsmeetup" and id "com.example.jsmeetup"
Downloading cordova library for www...
Download complete
$cd jsmeetup; tree trianglejs
.
├── config.xml
├── hooks
│ └── README.md
├── merges
├── platforms
├── plugins
└── www
├── css
│ └── index.css
├── img
│ └── logo.png
├── index.html
└── js
└── index.js
$ cordova platform add android
$ cordova platform add ios
$cordova platform ls
Installed platforms: android 3.5.0, ios 3.5.0
Available platforms: blackberry10, firefoxos
$ xcodebuild --help
Download XCode from Mac App Store
$ npm install -g ios-sim
$ ios-sim --version
$ 1.8.2
To Run App on iOS Simulator, instead of XCode GUI
$ npm install -g ios-deploy
$ ios-deploy --version
$ 1.0.4
To Run App on Device, instead of XCode GUI
$ ant -version
Get Ant from http://ant.apache.org
$ java -version
Get JDK SE from http://www.oracle.com/technetwork/java/javase
$ android --help
Get Android SDK from http://developer.android.com/sdk
Add Android tools to path
$ android list target
Install Android API (i.e. API 19 = 4.4)
Use Android SDK Manager, $ android sdk
$ android list avd
(Optional) Create Android Device Emulator if you don't have an Android Phone or Tablet
$ adb --help
Add Android platform-tools to path
$ msbuild /?
Download Visual Studio and Windows Phone SDK 8 dev.windowsphone.com
For Windows Phone 8 SDK you need Windows 8 or higher
Add msbuild.exe to the path if not already presetn in
To Run the Emulator check that Computer supports hyperv, or VM is setup with the cpu flag
$ cordova plugin add org.apache.cordova.device
Fetching plugin "org.apache.cordova.device" via plugin registry
$ cordova plugin add org.apache.cordova.camera
Fetching plugin "org.apache.cordova.camera" via plugin registry
$ cordova plugin ls
[ 'org.apache.cordova.device',
'org.apache.cordova.camera' ]
$ cordova build android
Generating config.xml from defaults for platform "android"
Preparing android project
Platform "android" compiled successfully.
$ cordova build ios
Generating config.xml from defaults for platform "ios"
Preparing ios project
Platform "ios" compiled successfully.
$ cordova run android
$ cordova emulate ios
Slides: csantana.io