creating mobile apps with php & symfony2
DESCRIPTION
TRANSCRIPT
![Page 1: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/1.jpg)
Creating Mobile Apps with PHP & Symfony2
Pablo Godel @pgodel
http://joind.in/8675Symfony Live, Portland, May 22 2013
Thursday, May 23, 13
![Page 2: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/2.jpg)
⁃ Born in Argentina, living in the US since 1999⁃ PHP & Symfony developer⁃ Founder of the original PHP mailing list in spanish ⁃ Master of the parrilla⁃ Co-founder of ServerGrove
Who am I?!
Thursday, May 23, 13
![Page 3: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/3.jpg)
Thursday, May 23, 13
![Page 4: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/4.jpg)
Thursday, May 23, 13
![Page 5: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/5.jpg)
⁃ Founded ServerGrove Networks in 2005
⁃ Provider of web hosting specialized in PHP, Symfony, ZendFramework, MongoDB and others
⁃ Servers in USA and Europe!
Who am I?!
Thursday, May 23, 13
![Page 6: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/6.jpg)
⁃ Very active open source supporter through codecontributions and usergroups/conference sponsoring
Community is our Teacher
Thursday, May 23, 13
![Page 7: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/7.jpg)
Why?
Mobile Apps - Why
Thursday, May 23, 13
![Page 8: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/8.jpg)
•More & more people have access to Internet through mobile devices
Mobile Apps - Why
Thursday, May 23, 13
![Page 9: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/9.jpg)
•More & more people have access to Internet through mobile devices
•Devices are more powerful & versatile
Mobile Apps - Why
Thursday, May 23, 13
![Page 10: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/10.jpg)
•More & more people have access to Internet through mobile devices
•Devices are more powerful & versatile• Internet access is faster and more reliable
Mobile Apps - Why
Thursday, May 23, 13
![Page 11: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/11.jpg)
•More & more people have access to Internet through mobile devices
•Devices are more powerful & versatile• Internet access is faster and more reliable•Users demand services and applications on the go at all
times
Mobile Apps - Why
Thursday, May 23, 13
![Page 12: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/12.jpg)
•More & more people have access to Internet through mobile devices
•Devices are more powerful & versatile• Internet access is faster and more reliable•Users demand services and applications on the go at all
times•Don’t give advantages in an ultra-competitive market
Mobile Apps - Why
Thursday, May 23, 13
![Page 13: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/13.jpg)
Some numbers...
Mobile Apps - Why
Thursday, May 23, 13
![Page 14: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/14.jpg)
•Estimated 6.5 billion mobile subscriptions globally (over 90%)
Mobile Apps - Why
Thursday, May 23, 13
![Page 15: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/15.jpg)
•Estimated 6.5 billion mobile subscriptions globally (over 90%)
•1.7 billion mobile phones sold in 2012
Mobile Apps - Why
Thursday, May 23, 13
![Page 16: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/16.jpg)
•Estimated 6.5 billion mobile subscriptions globally (over 90%)
•1.7 billion mobile phones sold in 2012•1 billion users in China alone
Mobile Apps - Why
Thursday, May 23, 13
![Page 17: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/17.jpg)
•Estimated 6.5 billion mobile subscriptions globally (over 90%)
•1.7 billion mobile phones sold in 2012•1 billion users in China alone•321M subscriptions in the US (over 100%)
Mobile Apps - Why
Thursday, May 23, 13
![Page 18: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/18.jpg)
•Estimated 6.5 billion mobile subscriptions globally (over 90%)
•1.7 billion mobile phones sold in 2012•1 billion users in China alone•321M subscriptions in the US (over 100%)•Devices range from phone and tablets to door locks,
thermostats, TVs, Cars, etc.
Mobile Apps - Why
Thursday, May 23, 13
![Page 19: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/19.jpg)
How did we get here?
Mobile Apps - Why
Thursday, May 23, 13
![Page 20: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/20.jpg)
Let’s see some history...
Mobile Apps - History
Thursday, May 23, 13
![Page 21: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/21.jpg)
First commercial cellular network launched in
Japan )1G - first generation(
1979
Mobile Apps - History
Thursday, May 23, 13
![Page 22: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/22.jpg)
The “mobile” telephone
Motorola DynaTAC -
aka “The Boot”cost: US$ 3995weight:793g / 28 ounces
1983 Motorola DynaTAC
Mobile Apps - History
Thursday, May 23, 13
![Page 23: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/23.jpg)
Common Standard to connect networks and apps
•WAP client•Server sends WML (XML)
WAP - Wireless Application Protocol
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml" ><wml> <card id="main" title="First Card"> <p mode="wrap">This is a sample WML page.</p> </card></wml>
1997
Mobile Apps - History
Thursday, May 23, 13
![Page 24: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/24.jpg)
WAP/WML
Mobile Apps - History
Thursday, May 23, 13
![Page 25: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/25.jpg)
WAP/WML
Mobile Apps - History
Thursday, May 23, 13
![Page 26: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/26.jpg)
WAP/WML
Mobile Apps - History
Thursday, May 23, 13
![Page 27: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/27.jpg)
Developer:
WAP/WML
Mobile Apps - History
Thursday, May 23, 13
![Page 28: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/28.jpg)
User:
WAP/WML
Mobile Apps - History
Thursday, May 23, 13
![Page 29: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/29.jpg)
2007...
Mobile Apps - History
Thursday, May 23, 13
![Page 30: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/30.jpg)
•Revolutionized the market of mobile telephony
•Safari Web Client
iPhone2007
Mobile Apps - History
Thursday, May 23, 13
![Page 31: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/31.jpg)
iPhone App Store2007
Mobile Apps - History
Thursday, May 23, 13
![Page 32: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/32.jpg)
First Android Device2008
Mobile Apps - History
Thursday, May 23, 13
![Page 33: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/33.jpg)
iPad2010
Mobile Apps - History
Thursday, May 23, 13
![Page 34: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/34.jpg)
So what does all this mean?
Mobile Apps - History
Thursday, May 23, 13
![Page 35: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/35.jpg)
The PC is not dead
The Mobile Generation
Mobile Apps - History
Thursday, May 23, 13
![Page 36: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/36.jpg)
The PC is not dead, yet?
The Mobile Generation
Mobile Apps - History
Thursday, May 23, 13
![Page 37: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/37.jpg)
Information is now consumed on phones and tablets
The Mobile Generation
Mobile Apps - History
Thursday, May 23, 13
![Page 38: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/38.jpg)
And this is just the beginning...
The Mobile Generation
Mobile Apps - History
Thursday, May 23, 13
![Page 39: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/39.jpg)
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 40: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/40.jpg)
Mobile Apps - Symfony
Definition by Fabien Potencier:
⁃ Symfony2 is a reusable set of standalone, decoupled, and cohesive PHP components
that solve common web development
problems.
⁃ Based on these components, Symfony2 is
also a full-stack web framework.
http://fabien.potencier.org/article/49/what-is-symfony2
Thursday, May 23, 13
![Page 41: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/41.jpg)
25 high quality components
http://symfony.com/doc/current/components/index.html
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 42: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/42.jpg)
• DependencyInjection• EventDispatcher• HttpFoundation• DomCrawler• ClassLoader• CssSelector• HttpKernel• BrowserKit• Templating• Translation• Serializer• Validator • Security • Routing • Console • Process • Config • Finder • Locale • Yaml• Form• ...
Components:
GitHub: http://github.com/symfony
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 43: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/43.jpg)
Mobile Apps - Symfony
Silex
The PHP/‘Symfony’ micro-framework
http://silex.sensiolabs.org/
// web/index.php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application();
$app->get('/hello/{name}', function ($name) use ($app) { return 'Hello '.$app->escape($name);});
$app->run();
Thursday, May 23, 13
![Page 44: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/44.jpg)
Why Symfony?
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 45: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/45.jpg)
•Provides solid base to build good HTTP & RESTful APIs
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 46: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/46.jpg)
•Provides solid base to build good HTTP & RESTful APIs
•Twig makes it easy to build templates for mobile devices
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 47: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/47.jpg)
•Provides solid base to build good HTTP & RESTful APIs
•Twig makes it easy to build templates for mobile devices
•Re-use code for different devices thanks to templates, controllers and routing
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 48: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/48.jpg)
•Provides solid base to build good HTTP & RESTful APIs
•Twig makes it easy to build templates for mobile devices
•Re-use code for different devices thanks to templates, controllers and routing
•Bundles + Composer = Endless possibilities!
Mobile Apps - Symfony
Thursday, May 23, 13
![Page 49: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/49.jpg)
&Mobile Web Applications
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 50: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/50.jpg)
http://forecast.io
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 51: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/51.jpg)
Frameworks HTML / Javascript • iui http://code.google.com/p/iui/ (one of the first ones)
• JQuery Mobile http://jquerymobile.com/ (Open source)
• JQTouch http://jqtouch.com/ (Open source)
• DHTMLX Touch http://dhtmlx.com/touch/ (Open source)
• The M Project http://www.the-m-project.org/ (Open source)
• Sensa Touch http://www.sencha.com/products/touch/
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 52: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/52.jpg)
jQuery Mobile
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 53: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/53.jpg)
Supports:- IOS (iPhone/iPad)- Android- Blackberry- Windows Phone- palm webOS- symbian
jQuery Mobile
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 54: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/54.jpg)
jQuery Mobile
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 55: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/55.jpg)
•Based on jQuery
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 56: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/56.jpg)
•Based on jQuery•Light (40KB)
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 57: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/57.jpg)
•Based on jQuery•Light (40KB)•HTML5
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 58: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/58.jpg)
•Based on jQuery•Light (40KB)•HTML5 •Accessible (works on screen readers)
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 59: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/59.jpg)
•Based on jQuery•Light (40KB)•HTML5 •Accessible (works on screen readers)•Events, plugins, themes
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 60: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/60.jpg)
•Based on jQuery•Light (40KB)•HTML5 •Accessible (works on screen readers)•Events, plugins, themes•Lots of documentation
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 61: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/61.jpg)
•Page management
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 62: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/62.jpg)
•Page management•Transitions
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 63: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/63.jpg)
•Page management•Transitions•Dialog windows
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 64: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/64.jpg)
•Page management•Transitions•Dialog windows•Links and buttons
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 65: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/65.jpg)
•Page management•Transitions•Dialog windows•Links and buttons•Navigation bars
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 66: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/66.jpg)
•Page management•Transitions•Dialog windows•Links and buttons•Navigation bars•Header / Footer
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 67: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/67.jpg)
•Page management•Transitions•Dialog windows•Links and buttons•Navigation bars•Header / Footer•Forms
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 68: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/68.jpg)
•Page management•Transitions•Dialog windows•Links and buttons•Navigation bars•Header / Footer•Forms•Lists
jQuery Mobile - Features
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 69: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/69.jpg)
jQuery Mobile - Page management
<body>
<!-- Start of first page --><div data-role="page" id="foo">
! <div data-role="content">!! ! <p>I'm first in the source order so I'm shown as the page. </p>!!! ! <p>View internal page called <a href="#bar">bar</a></p>!! </div><!-- /content -->
</div><!-- /page -->
</body>
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 70: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/70.jpg)
<body>
<!-- Start of first page --><div data-role="page" id="foo">
! <div data-role="content">!! ! <p>View internal page called <a href="#bar">bar</a></p>!! </div><!-- /content -->
</div><!-- /page -->
<!-- Start of second page --><div data-role="page" id="bar">
! <div data-role="content">!! ! <p><a href="#foo">Back to foo</a></p>!! </div><!-- /content -->
</div><!-- /page --></body>
jQuery Mobile - Page management
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 71: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/71.jpg)
jQuery Mobile - Transitions
<a href="foo.html" data-rel="dialog" data-transition="pop">Open dialog</a>
<a href="foo.html" data-rel="dialog" data-transition="slidedown">Open dialog</a>
<a href="foo.html" data-rel="dialog" data-transition="flip">Open dialog</a>
<a href="foo.html" data-rel="dialog" data-transition="fade">Open dialog</a>
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 72: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/72.jpg)
jQuery Mobile - Dialogs
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 73: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/73.jpg)
jQuery Mobile - Navigation bars
<div data-role="header" data-position="inline">! <a href="index.html" data-icon="delete">Cancel</a>! <h1>Edit Contact</h1>! <a href="index.html" data-icon="check">Save</a></div>
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 74: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/74.jpg)
jQuery Mobile - Forms
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 75: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/75.jpg)
jQuery Mobile - Forms
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 76: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/76.jpg)
jQuery Mobile - Lists
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 77: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/77.jpg)
&jQuery Mobile
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 78: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/78.jpg)
Templates
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 79: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/79.jpg)
<!DOCTYPE html><html><head> <title>Podisum by ServerGrove</title> <meta name="viewport" content="width=device-width, initial-scale=1"></head>
<body>
{% block content %}{% endblock %}
</body></html>
layout.html.twig
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 80: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/80.jpg)
{% extends "layout.html.twig" %}
{% block content %} <div data-role="page" id="home"> <div data-role="header"> <h1>Podisum</h1> </div> <div data-role="content">
<1-- ... --> </div> </div>
index.html.twig
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 81: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/81.jpg)
<div data-role="header" data-theme="b"> <h1>{{title}}</h1> <a href="#home" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home" data-ajax="false">Home</a></div>
header.html.twig
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 82: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/82.jpg)
{% extends "layout.html.twig" %}
{% block content %}{% include “header.html.twig’ %}
<div data-role="content"><1-- ... -->
</div> </div>
index.html.twig
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 83: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/83.jpg)
Routing
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 84: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/84.jpg)
home: pattern: / defaults: { _controller: DemoBundle:Default:index }talks: pattern: /talks.{_format} defaults: { _controller: DemoBundle:Talk:index, _format: html } requirements: _format: html|xml|icstalk: pattern: /talk/{slug} defaults: { _controller: DemoBundle:Talk:talk }
jQuery Mobile & Symfony / Routing
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 85: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/85.jpg)
jQuery Mobile & Symfony / Routing
home: pattern: /m defaults: { _controller: DemoBundle:Default:index,_format:mhtml }talks: pattern: /m/talks defaults: { _controller: DemoBundle:Talk:index, _format:mhtml }talk: pattern: /m/talk/{slug} defaults: { _controller: DemoBundle:Talk:talk, _format:mhtml }
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 86: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/86.jpg)
jQuery Mobile & Symfony / Routing (option 2)
home: pattern: /m defaults: { _controller: DemoBundle:Default:index, mobile:true }talks: pattern: /m/talks defaults: { _controller: DemoBundle:Talk:index, mobile:true }talk: pattern: /m/talk/{slug} defaults: { _controller: DemoBundle:Talk:talk, mobile:true }
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 87: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/87.jpg)
m_home: pattern: /m defaults: { _controller: DemoBundle:Mobile:index }
jQuery Mobile & Symfony / Routing (option 3)
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 88: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/88.jpg)
Controllers & Actions
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 89: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/89.jpg)
jQuery Mobile & Symfony / Controller & Action
public function indexAction() { $em = $this->get('doctrine')->getEntityManager(); // ...
$format = $this->get('request')->getRequestFormat();
return $this->render('DemoBundle:Default:index.'.$format.'.twig', array( // ... )); }
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 90: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/90.jpg)
Detect Mobile Devices
•http://mobiledetect.net/
•Symfony2 + MobileDetectBundle
•Silex + MobileDetectServiceProvider
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 91: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/91.jpg)
Mobile Apps - Web AppsMobileDetectBundle
public function indexAction() { $em = $this->get('doctrine')->getEntityManager(); // ...
$mobileDetector = $this->get('mobile_detect.mobile_detector');
$tpl = $mobileDetector->isMobile() ? ‘mhtml’ : ‘html’;
return $this->render('DemoBundle:Default:index.'.$tpl.'.twig', array( // ... )); }
Thursday, May 23, 13
![Page 92: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/92.jpg)
Mobile Apps - Web AppsMobileDetectBundle
{% if is_mobile() %}{% if is_tablet() %}{% if is_device('iphone') %} # magic methods is[...]
{% extends is_mobile() ? "MyBundle:Layout:mobile.html.twig" : "MyBundle:Layout:full.html.twig" %}
Thursday, May 23, 13
![Page 93: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/93.jpg)
Mobile Apps - Web AppsMobileDetectBundle
mobile_detect: redirect: mobile: is_enabled: true host: http://m.site.com status_code: 301 action: redirect tablet: ~ switch_device_view: ~
Thursday, May 23, 13
![Page 94: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/94.jpg)
•Symfony2 functional tests for HTML pages
•For AJAX other testing methods may be used:•Selenium RC•Behat
Mobile Apps - Web Apps
Testing
Thursday, May 23, 13
![Page 95: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/95.jpg)
DEMOS !
Podisum: http://github.com/pgodel/podisum
sunshinephphttp://m.sunshinephp.com/
Control Panel:•https://control.servergrove.com/•https://control.servergrove.com/m
login: [email protected]: demo
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 96: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/96.jpg)
Podisum http://github.com/pgodel/podisum
•Generates summaries of Logstash events•Silex app•Twig templates•Mobile version
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 97: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/97.jpg)
Podisum
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 98: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/98.jpg)
Podisum
Apache access_log Logstash
Redis
Podisum redis-client
MongoDB
Podisum Silex App
Web Client
Mobile Apps - Web Apps
Thursday, May 23, 13
![Page 99: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/99.jpg)
Mobile Apps
&Native Applications
Thursday, May 23, 13
![Page 100: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/100.jpg)
• iPhone - Objective-C•Android - Java•Windows Mobile - .NET•Frameworks multi-platform⁃ PhoneGap http://phonegap.com⁃ rhomobile http://rhomobile.com⁃ Appceledator http://appcelerator.com⁃ Corona http://anscamobile.com/corona/
Mobile Apps - Native Apps
Thursday, May 23, 13
![Page 101: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/101.jpg)
Mobile Apps - Native Apps
PHP does not run in these devices but native apps need to retrieve and store data from servers.
Thursday, May 23, 13
![Page 102: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/102.jpg)
Common uses:•send emails & messages in general• loading of profile data•authentication & authorization•chats
Mobile Apps - Native Apps
PHP does not run in these devices but native apps need to retrieve and store data from servers.
Thursday, May 23, 13
![Page 103: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/103.jpg)
Some considerations:•Design API (RESTful, HTTP, XML-RPC) early on at
the development cycle
Mobile Apps - Native Apps
Thursday, May 23, 13
![Page 104: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/104.jpg)
Some considerations:•Design API (RESTful, HTTP, XML-RPC) early on at
the development cycle•APIs can be used by multiple types of clients
Mobile Apps - Native Apps
Thursday, May 23, 13
![Page 105: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/105.jpg)
Some considerations:•Design API (RESTful, HTTP, XML-RPC) early on at
the development cycle•APIs can be used by multiple types of clients •Re-use controllers and use _format to generate
different content types (XML, JSON, etc)
Mobile Apps - Native Apps
Thursday, May 23, 13
![Page 106: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/106.jpg)
Build APIs with Symfony2
- FOSRestBundlehttps://packagist.org/packages/friendsofsymfony/rest-bundle
- ApiDocBundlehttps://packagist.org/packages/nelmio/api-doc-bundle
Mobile Apps - Native Apps
Thursday, May 23, 13
![Page 107: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/107.jpg)
Build APIs with Symfony2
- FOSRestBundlehttps://packagist.org/packages/friendsofsymfony/rest-bundle
- ApiDocBundlehttps://packagist.org/packages/nelmio/api-doc-bundle
Mobile Apps - Native Apps
Build APIs with Silex
- responsible-service-provider
- silex-skeleton-rest
Thursday, May 23, 13
![Page 108: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/108.jpg)
Push Notifications
Server sends messages to mobile devices- AppleApnPushBundle- RMSPushNotificationsBundle- DABSquaredPushNotificationsBundle- ZendService\Google\Gcm- ZendService\Apple\Apns
Mobile Apps - Native Apps
Thursday, May 23, 13
![Page 109: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/109.jpg)
Mobile Apps - Native AppsRMSPushNotificationsBundle
public function pushAction() { $message = new iOSMessage(); $message->setMessage('Oh my! A push notification!'); $message->setDeviceIdentifier('test012fasdf482asdfd63f6d7bc6d4293aedd5fb448fe505eb4asdfef8595a7');
$this->container->get('rms_push_notifications')->send($message);
return new Response('Push notification sent!'); }
Thursday, May 23, 13
![Page 110: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/110.jpg)
Mobile Apps - SMS Apps
&SMS (and voice) Applications
Thursday, May 23, 13
![Page 111: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/111.jpg)
Mobile Apps - SMS Apps
Thursday, May 23, 13
![Page 112: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/112.jpg)
Symfony can send/receive text messages
Common uses:- Alerts- Chats- Electronic payments- Ads- Two-factor authentication
Mobile Apps - SMS Apps
Thursday, May 23, 13
![Page 113: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/113.jpg)
SMS Gateway providers:•Twilio•Nexmo•Clickatell•BulkSMS
Mobile Apps - SMS Apps
Thursday, May 23, 13
![Page 114: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/114.jpg)
Mobile Apps - SMS AppsVreshTwilioBundle
$twilio = $this->get('twilio.api');
$message = $twilio->account->sms_messages->create( '9991231234', // From a valid Twilio number '8881231234', // Text this number "Hello monkey!" );
Thursday, May 23, 13
![Page 115: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/115.jpg)
Mobile Apps - Voice AppsTwilio-php SDK
$client = new Services_Twilio($sid, $token);$call = $client->account->calls->create( '9991231234', // From a valid Twilio number '8881231234', // Call this number
// Read TwiML at this URL when a call connects (hold music) 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient');
Thursday, May 23, 13
![Page 116: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/116.jpg)
MMS are multimedia messages with text, images, video, audio.Common uses:- Photo processing- Sending/scanning 2D barcodes
Mobile Apps - SMS/MMS Apps
https://github.com/endroid/QrCodehttps://github.com/endroid/EndroidQrCodeBundlehttps://github.com/mkoppanen/php-zbarcode
Thursday, May 23, 13
![Page 117: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/117.jpg)
Mobile Apps - Hybrid Apps
&Hybrid Applications
(mix native, web, others)
Thursday, May 23, 13
![Page 118: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/118.jpg)
Applications that combine web, sms, voice and native aspects
Framework PhoneGap
- Build apps with HTML & JavaScript- Integrates with XCode- Compiles app into native code- Access to accelerometer, camera, geolocation, notifications and more
Mobile Apps - Hybrid Apps
Thursday, May 23, 13
![Page 119: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/119.jpg)
Questions?
Mobile Apps
Thursday, May 23, 13
![Page 120: Creating Mobile Apps With PHP & Symfony2](https://reader033.vdocuments.us/reader033/viewer/2022051400/54c69ace4a795911528b4587/html5/thumbnails/120.jpg)
Twitter: @pgodel IRC Freenode: pgodel
Source: https://github.com/pgodel/podisumSlides: http://slideshare.net/pgodel
Mobile Apps - Thanks!Feedback Please:
http://joind.in/8675
Thank you!
Thursday, May 23, 13