Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. ·...

61
The story behind PF2014 http://pf2014.sinusgear.com Juraj Michálek Brno

Transcript of Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. ·...

Page 1: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

The story behind PF2014http://pf2014.sinusgear.com

Juraj MichálekBrno

Page 2: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Creativity is just connecting things.- Jobs

Page 3: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-
Page 4: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Motivation

Create something new

Learn something new

Do something new

Page 5: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

PF 2010

Page 6: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

PF 2011

Page 7: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

PF 2012

HTML5 Canvas

Page 8: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

PF 2013

Webfonts

Page 9: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

PF 2014?

Mobile

Touch

Page 10: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Apache Cordova

Page 11: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-
Page 12: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-
Page 13: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Install NodeJS

Page 14: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Install Cordova

Page 15: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Create project

Page 16: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Add platform

Page 17: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Build

Page 18: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Emulate - AVD Manager

Page 19: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Import to Idea

Page 20: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Correction of modules

Page 21: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Run/Emulate from Idea

Page 22: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Logs

Page 23: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Cordova project structure

● platforms○ android○ ios

● plugins● www (edit code here)

Page 24: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Testing in browser

Page 25: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

HTML5 Canvas - EaselJS

A Javascript library that makes working with the HTML5 Canvas element easy.

Page 26: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Problems

performance: Caching demo - 2 FPS - Samsung Galaxy Sworse tooling than HTML :-(

Page 27: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Constellations

Page 28: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Tracing Paper tool

http://tp.sinusgear.com

Page 29: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Display stars<i class="positionMarker fa fa-star"

data-index="{{$index}}"ng-repeat="item in visibleStars" ng-style="getStarStyle(item)">

</i>

Page 30: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

http://fontawesome.io/

Page 31: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Use Font Awesome in Cordova

Page 32: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Drag the star

Angular-drag-drop, Angular-touch

angular.module('app', ['ngTouch', 'ngDragDrop']) .controller('ConstellationController',...

Page 33: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Drag’n’drop

jQuery-ui - animationdrag by mouse

Page 34: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

No Canvas?

How to draw a line?!

Page 35: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Div + CSS3

.line {width: 100px;

height: 2px;transform: rotate(120deg);background: lightyellow; ...

}

Page 36: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

AngularJS dynamic style

<div class="line" ng-repeat="line in visibleLines" ng-style="getLineStyle(line)">

</div>

Page 37: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Chrome Developer Tools - F12

Page 38: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

GoogleChromeCanary

Page 39: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Mobile device emulation

Page 40: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Hups!

Drag’n’drop does not work on mobile!

Page 41: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Event mapping override switch(event.type) { case "touchstart": type = "mousedown"; break; case "touchmove": type="mousemove"; break; case "touchend": type="mouseup"; break; default: return; }

Page 42: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Persisting game state

Page 43: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Angular local storage

Page 44: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Going mobile

Page 45: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

https://play.google.com/apps/publishRegistration: 25$

- one time payment for developer

Page 46: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Signed APK

Page 47: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Prepare and publish

https://play.google.com/apps/publish

Page 48: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Review ~ 1 day

Page 49: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Going live

Page 50: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Analytics

Page 51: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

http://developer.apple.comRegistration: 99$ / yearApproved bank account: ~2 days

Page 52: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-
Page 53: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-
Page 54: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Build: only Mac OS X- requires: XCode- sign by valid Apple certificate

Page 55: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Review: 5-7 days

Page 56: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

http://www.windowsphone.com/Registration: 19$/yearBuild: WP8 requires Windows 8

Page 57: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

https://developer.amazon.com/home.html

Registration: freeReview: ~1 day

Page 58: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-
Page 59: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

PF 2014 summary

Web: 188 visitsGoogle Play: 25Amazon: 6Apple App Store: 0, still waiting for approval

Campaign channels: Mail, Skype, Google+

Page 60: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Grab the source code :-)

https://github.com/georgik/pf2014

Page 61: Brno Juraj Michálek ://georgik.rocks/wp-content/talks/2014-01-08-the... · 2014. 1. 8. · Problems performance: Caching demo - 2 FPS - Samsung Galaxy S worse tooling than HTML :-

Share and enjoy

PF 2014: http://georgik.sinusgear.com/2013/12/28/pf-2014/

PF 2013: http://georgik.sinusgear.com/2012/12/22/pf-2013/

PF 2012: http://georgik.sinusgear.com/2011/12/31/pf-2012/

PF 2011: http://georgik.sinusgear.com/2010/12/23/pf2011/

PF 2010: http://georgik.sinusgear.com/2009/12/26/pf-2010/