68
C R E A T I N G M O B I L E A P P S W I T H C O R D O V A Demian Borba Design Thinker, BlackBerry Developer Evangelist @demianborba

Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Embed Size (px)

DESCRIPTION

Understand everything that is needed to create cross platform mobile applications using Cordova for iOS, Android and BlackBerry 10. We will go through all the steps for configuring your machine (Mac or Windows), as well as add Cordova and WebWorks plugins. We will see how to package, deploy and debug hybrid apps on BlackBerry 10 and Android devices. In the end, we will inspect the project phonegapbootcamp.io, an open source website/mobileapp built with Angular, Gulp and Cordova.

Citation preview

Page 1: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

C R E A T I N G

M O B I L E A P P S

W I T H C O R D O V A

Demian BorbaDesign Thinker, BlackBerry Developer Evangelist

@demianborba

Page 2: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 3: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

• Graduated in Industrial Design (CEFET-PR)

• Graduated in Computer Science (UFAL)

• Crazy about Design, UX, Business and Technology

• Former Instructor at UCSD, Platt College and Art Institute

• Working with Interactive Media for over 15 years

• Founder of Action Creations, interactive agency in California

• Developer Evangelist, 90% #upintheair (Americas+Asia+Europe)

• Created the project www.designthinkingnow.com

• www.phonegapbootcamp.io creator

A B O U T

M E

Page 4: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

dborba.com html5test.com

Page 5: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

@demianborba @gustavocostaw @joselitojunior1

Page 6: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 7: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

http://phonegapbootcamp.io

Page 8: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

https://play.google.com/store/apps/details?id=io.phonegapbootcamp.appandroid

Page 9: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

http://appworld.blackberry.com/webstore/content/54145887

Page 10: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

• Understand what Cordova/PhoneGap is

• Understand how to configure your computers (Mac or Windows)

• Understand how to create a project with Cordova Source (not CLI)

• Understand how to build apps for iOS, Android and BlackBerry 10

• Understand how to use Cordova and WebWorks plugins

• Understand how to deploy and debug your app on a real device (BlackBerry 10)

• Understand www.phonegapbootcamp.io code (open source) angular+gulp+cordova.

G O A L S

T O D A Y

Page 11: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

W H A T

C O R D O V A

I S

?

P H O N E G A P ?

Page 12: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 13: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 14: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

C O N F I G U R I N G

Y O U R C O M P U T E R

Page 15: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 16: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 17: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 18: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Download and Install Node: http://nodejs.org/download/

Page 19: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Download and unzip ANT: http://ant.apache.org/bindownload.cgi

Page 20: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Adding ANT to system PATH (Windows)

;C:\your\folder\apache-ant-1.9.4\bin\

Page 21: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Add ANT to your system PATH (Mac)

export PATH="/Developer/apache-ant-1.9.4/bin:$PATH"

Page 22: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Download Cordova Source: http://cordova.apache.org

Page 23: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 24: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 25: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 26: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 27: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 28: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

jdk + jre + adt-bundle (http://developer.android.com/sdk/index.html)

Page 29: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

export PATH="/Applications/adt-bundle-mac-x86_64-20131030/sdk/platform-tools:$PATH"

export PATH="/Applications/adt-bundle-mac-x86_64-20131030/sdk/tools:$PATH"

Page 30: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 31: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Download http://developer.blackberry.com/native/downloads

Page 32: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

export PATH="/Applications/Momentics.app/host_10_2_0_15/darwin/x86/usr/bin:$PATH"

Page 33: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 34: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

U S I N G

C O R D O V A

Page 35: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Unzip cordova-3.4.0-src.zip

Page 36: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Unzip {{ wanted-platform }}

Page 37: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Creating your first project

Page 38: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Creating your first Cordova project for iOS

Page 39: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Creating your first Cordova project for Android

Page 40: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Creating your first Cordova project for BlackBerry 10

Page 41: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Adding a Target Device (BlackBerry 10)

Page 42: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

B U I L D I N G

F I R S T

Y O U R

A P P

Page 43: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Building your First App (iOS or Android)

Page 44: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Building your First App (BlackBerry 10) RELEASE MODE

Page 45: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Building your First App (BlackBerry 10) DEBUG MODE

Page 46: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

U S I N G A N DC O R D O V A

W E B W O R K S P L U G I N S

Page 47: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

CORDOVA DOCS: http://cordova.apache.org/docs/en/edge/index.html

Page 48: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Cordova PLUGIN APIs

Battery Status: Monitor the status of the device's battery.

Camera: Capture a photo using the device's camera.

Contacts: Work with the devices contact database.

Device: Gather device specific information.

Device Motion (Accelerometer): Tap into the device's motion sensor.

Device Orientation (Compass): Obtain the direction that the device is pointing.

Dialogs: Visual device notifications.

FileSystem: Hook into native file system through JavaScript.

File Transfer: Hook into native file system through JavaScript.

Geolocation: Make your application location aware.

Globalization: Enable representation of objects specific to a locale.

InAppBrowser: Launch URLs in another in-app browser instance.

Media: Record and play back audio files.

Media Capture: Capture media files using device's media capture applications.

Network Information (Connection): Quickly check the network state, and cellular network information.

Splashscreen: Show and hide the applications splash screen.

Vibration: An API to vibrate the device.

Page 49: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Meeting PLUGMAN

https://cordova.apache.org/docs/en/edge/plugin_ref_plugman.md.html

INSTALLING PLUGMAN

npm install -g plugman

INSTALLING A PLUGIN

plugman install --platform <ios|android|blackberry10> --project <directory> --plugin <pluginID>

UNINSTALLING A PLUGIN

plugman uninstall --platform <ios|android|blackberry10> --project <directory> --plugin <pluginID>

Page 50: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Using WebWorks PLUGINS (BlackBerry 10)

https://github.com/blackberry/BB10-WebWorks-Samples/tree/WebWorks-2.0/Localization

plugman install --platform blackberry10 --project

PROJECTROOTFOLDER --plugin com.blackberry.system

Page 51: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 52: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 53: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

D E P L O Y I N G

D E B U G G I N GA N D

Y O U R A P P

Page 54: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Deploying your App (iOS or Android)

Page 55: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Deploying your App (BlackBerry 10)

Page 56: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

Debugging your App (BlackBerry 10)

Page 57: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

App Stores

Page 58: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 59: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

P H O N E G A P

B O O T C A M P . I O

Page 60: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

https://github.com/demianborba/phonegapbootcampsite

Page 61: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 62: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 63: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 64: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 65: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

http://ionicframework.com

Page 66: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

http://brackets.io

Page 67: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10
Page 68: Creating mobile apps with Cordova for iOS, Android and BlackBerry 10

T H A N K

Y O U

Demian BorbaDesign Thinker, BlackBerry Developer Evangelist

@demianborba