22
Native Mobile Apps with Cordova, Angular and Ionic Eddie Lau @tatonlto github.com/3dd13

Cordova, Angularjs & Ionic @ Codeaholics

Embed Size (px)

DESCRIPTION

Sharing on the tools I used to build a real time chatting hybrid mobile apps

Citation preview

Page 1: Cordova, Angularjs & Ionic @ Codeaholics

Native Mobile Apps with Cordova, Angular and Ionic

Eddie Lau @tatonlto

github.com/3dd13

Page 2: Cordova, Angularjs & Ionic @ Codeaholics

Toolbox

Page 3: Cordova, Angularjs & Ionic @ Codeaholics
Page 4: Cordova, Angularjs & Ionic @ Codeaholics

1. Cordova

• Create (Generate folder skeleton) • Build (Generate mobile native apps) • Deploy (Transfer to emulators and Devices)

handles the native apps layer:

Page 5: Cordova, Angularjs & Ionic @ Codeaholics

1. Cordova

cordova build # generate native apps projects

cordova emulate # deploy to and run in emulator

cordova run # deploy to and run in connected devices

Command line tools:

Page 6: Cordova, Angularjs & Ionic @ Codeaholics

2. Angularjs

MVC & Data Binding

Page 7: Cordova, Angularjs & Ionic @ Codeaholics

2. Angularjs

Angular modules

Page 8: Cordova, Angularjs & Ionic @ Codeaholics

3. Ionic• UI Components (with Mobile Design Patterns) http://ionicframework.com/docs/components/

Page 9: Cordova, Angularjs & Ionic @ Codeaholics

3. Ionic• Controllers & Angularjs binding http://ionicframework.com/docs/angularjs/controllers/side-menu/

Page 10: Cordova, Angularjs & Ionic @ Codeaholics

Chat Room Apps

Page 11: Cordova, Angularjs & Ionic @ Codeaholics

Requirements

• Mobile & Web (Cordova, AngularJs & Ionic) • Real Time (how?)

Chat Room Apps

Page 12: Cordova, Angularjs & Ionic @ Codeaholics

4. Firebase

easy to integrate cloud real time data source

Page 13: Cordova, Angularjs & Ionic @ Codeaholics

4. Firebaseeasy to integrate cloud real time data source

Page 14: Cordova, Angularjs & Ionic @ Codeaholics

4. Firebasejust magic !! 3 way data binding !!

Note: rooms is now a variable binding view model, scope model and remote firebase data source.

whenever the model changes at client or server, every view model get updated AUTOMAGICALLY

Page 15: Cordova, Angularjs & Ionic @ Codeaholics

How difficult it is ?!How long it takes ?

Page 16: Cordova, Angularjs & Ionic @ Codeaholics

Time spentBare ionic app (1 hour) Basic ui elements Make sure deployment works !Modify with some angular function (4 hours) Playing with ionic, angularjs Playing with layout !Changed to side menus (1 hour) How to interact with ionic ui with angular function !Use firebase (1 hour) Angular with firebase to do realtime

Page 17: Cordova, Angularjs & Ionic @ Codeaholics

Demohttps://github.com/3dd13/chatroom-cordova-ionic-angularjs-firebase

you can checkout by tags on different releases: !v1.0 - Built bare ionic app v2.0 - Added more ionic components v3.0 - Changed to side menus v4.0 - Linked to firebase

Page 18: Cordova, Angularjs & Ionic @ Codeaholics

cordova emulate android

Page 19: Cordova, Angularjs & Ionic @ Codeaholics

cordova emulate ios

Page 20: Cordova, Angularjs & Ionic @ Codeaholics

Of course ! it works on desktop browser too !

Page 21: Cordova, Angularjs & Ionic @ Codeaholics

Todo• Login with Gmail and Github (Angular-oauth) • Room access (Setup firebase security rules) • Invite users to the room !• Web chatting client • Customize Firebase endpoint (assigned by creator) • Customize mobile platform settings

Page 22: Cordova, Angularjs & Ionic @ Codeaholics

Questions ?

Eddie Lau @tatonlto

github.com/3dd13