SlideShare a Scribd company logo
PHP in a Mobile Ecosystem
Ivo Jansch - Egeniq
November 3, 2010 - Zendcon
1
Wednesday, November 3, 2010
About Egeniq
Startup
Mobile
Tech
Knowledge
Geeks
Development
2
Wednesday, November 3, 2010
About Me
@ijansch
Developer
Author
Entreprenerd
PHP
3
Wednesday, November 3, 2010
Part 1
Let’s think about mobile for a few minutes
4
Wednesday, November 3, 2010
The Web
is increasingly portable
5
Wednesday, November 3, 2010
It’s revolutionary
Much like when
the phone lost
its wall socket
6
Wednesday, November 3, 2010
The Internet Of Things
ivo-imac:~ ivo$ ping fridge
PING fridge (192.168.1.138): 56 data bytes
7
Wednesday, November 3, 2010
The Web versus The Internet
8
Wednesday, November 3, 2010
Usage Characteristics
On the go
Short attention span
Avoid typing
To the point / ad hoc
Omnipresent
9
Wednesday, November 3, 2010
Mobile Technologies
Objective-C (iPhone, iPad, iPod Touch, Apple TV)
Java (Android, Blackberry, Symbian)
HTML5 / Javascript (Any)
PHP (Any)
10
Wednesday, November 3, 2010
The App vs. The Browser
11
Wednesday, November 3, 2010
Browser based applications
Write once, run anywhere
Online
Requires browser
Page based
‘Stateless’
12
Wednesday, November 3, 2010
Native Apps
On- and offline
Event based
Native device experience
Convenient access to device features
Stateful
Monetization through App Stores
13
Wednesday, November 3, 2010
Some statistics
Android Market: 100.000 apps
Apple App Store: 300.000 apps
Web: 3.000.000 websites optimized for mobile
Sources:
http://www.bizreport.com/2010/10/dotmobi-2000-growth-in-number-of-mobile-ready-websites.html#
http://twitter.com/AndroidDev/status/28701488389
http://www.silobreaker.com/apples-app-store-crosses-300000-apps-5_2263799272514256896
14
Wednesday, November 3, 2010
Predictions
15
Wednesday, November 3, 2010
Part 2
Browser Based Mobile Apps
16
Wednesday, November 3, 2010
Device Detection
It’s all in the User Agent
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac
OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko)
Version / 4.0.5 Mobile/8B117 Safari/6531.22.7
Mozilla/5.0 (Linux; U; Android 2.1-update1; nl-nl; HTC
Hero Build/ERE27) AppleWebKit/ 530.17 (KHTML, like
Gecko) Version/4.0 Mobile Safari/ 530.17
17
Wednesday, November 3, 2010
Device Detection
18
Wednesday, November 3, 2010
Device Detection
http://detectmobilebrowsers.mobi/
Downloadable PHP library
for device detection
Online code generator
Donationware
Ugly code, well documented
19
Wednesday, November 3, 2010
Device Detection
http://www.deviceatlas.com
Database of device properties
Available online, as API and
downloadable json file
Free for development
~99$/year for production
http://wurfl.sourceforge.net/
20
Wednesday, November 3, 2010
Device Detection
Considerations:
Don’t redirect to homepage
Offer ‘classic’ option
Don’t make assumptions on screen size
21
Wednesday, November 3, 2010
Zend Framework Example
Take advantage of ZF’s powerful MVC set up
View scripts determine layout of actions
Layout script wraps everything into main layout
Use Bootstrapper to detect device and setup MVC
22
Wednesday, November 3, 2010
layouts/scripts/layout_mobile.phtml
23
Wednesday, November 3, 2010
views_mobile/scripts/index/index.phtml
24
Wednesday, November 3, 2010
Bootstrap.php
25
Wednesday, November 3, 2010
Result
Try it at http://egeniq.com/demo/zf/public
26
Wednesday, November 3, 2010
Zend_Http_UserAgent
New in Zend Framework 1.11
Can work with WURFL or Device Atlas
27
Wednesday, November 3, 2010
UI Design
Hover = evil
‘Finger Friendly Design’
‘Touch Driven Development’
Screens are getting bigger and (!) smaller
28
Wednesday, November 3, 2010
Scalable websites
http://www.niemanlab.org/2010/09/nyts-opinion-pages-continue-the-march-toward-
app-inspired-design/
29
Wednesday, November 3, 2010
HTML5 is easy
<!doctype html> - period.
<script> or <style> - period.
Semantics: header, footer, section, article tags
30
Wednesday, November 3, 2010
HTML5 is powerful
localStorage
<video>
<canvas>
<svg>
<input type=”number”> and many other form fields
navigator.geolocation.getCurrentPosition();
31
Wednesday, November 3, 2010
Browsers love HTML5
Browsers supporting HTML5:
Firefox
Safari
Opera
All the mobile browsers
IE (sort of, no support for <article> until IE9)
32
Wednesday, November 3, 2010
Things to consider
Don’t just scale the layout, scale content too
Consider ‘scenario based content management’
33
Wednesday, November 3, 2010
jQTouch
34
Wednesday, November 3, 2010
jQTouch
iPhone experience in HTML5
http://jqtouch.com/
jQuery based
MIT License
Give it a try: http://jqtouch.com/preview/demos/main
35
Wednesday, November 3, 2010
Alternatives
jQuery Mobile
1.0 alpha was released at October 16, 2010
http://jquerymobile.com/
Sencha Touch
From the makers of jqTouch
Tablet support
http://www.sencha.com/products/touch/
36
Wednesday, November 3, 2010
You already know PHP
Your PHP skills + HTML5 = easy mobile websites
37
Wednesday, November 3, 2010
Part 3
Native Apps
38
Wednesday, November 3, 2010
PHP’s role in native apps
iPhone
App
Android
App
Blackberry
App
API
39
Wednesday, November 3, 2010
Optimize APIs for mobile
Content optimization
Scalability
Longevity
Security
Client/Server considerations
40
Wednesday, November 3, 2010
Content Optimization
Consider CPU and memory constraints
Prefer JSON over XML
Compress data
Keep responses small
But not too small (connection / routing overhead)
41
Wednesday, November 3, 2010
Scalability
AppStore featured/top listings Slashdot effect
Consider the 80/20 rule of app popularity though
42
Wednesday, November 3, 2010
Longevity
Apps have different deployment patterns
No ‘quick fix’ in the application as in web apps
Client/Server asynchronous updates
Backwards compatibility
Versioned API URLs:
http://iportfolio.api.egeniq.com/portfolios/1.0/mvb/collections.json
43
Wednesday, November 3, 2010
Longevity
How long do you support your APIs?
Can’t force people to delete their Apps
Provide clean fallback
Synchronized instead of real-time data
Implement status check API calls
44
Wednesday, November 3, 2010
API Security
TLS/SSL
Basic Auth
OAuth? XAuth!
PKI / TLSAuth
Signed URLs:
?x=1&y=2
&signature=hash(secret, time limit, params)
45
Wednesday, November 3, 2010
Client/Server considerations
Image Processing in the API, instead of App
Use Imagick / GD etc.
Trade-off between bandwidth and processing power
Apps support threading / asynchronisity
Fire-and-forget API design
Prepare/getResult call duos
Push features into PHP APIs for reuse
46
Wednesday, November 3, 2010
PHP’s role in native apps
PHP has native support for:
Web services
JSON
Compression
Image manipulation
Egeniq’s number 1 choice for App APIs
25-30% of App development time = API
47
Wednesday, November 3, 2010
Part 4
Best of Both Worlds
48
Wednesday, November 3, 2010
HTML5 in the App Store
HTML5 on the server, supports PHP:
IPFaces - http://www.ipfaces.org/
HTML5 on the device, no (or limited) support for PHP:
AppCelerator - http://appcelerator.com/
Phonegap - http://phonegap.com
49
Wednesday, November 3, 2010
Part 5
Random bits if time permits
50
Wednesday, November 3, 2010
Running PHP on the device
First: Why??!
PHP For Android (PFA)
http://phpforandroid.net/
PAMP for Symbian
http://wiki.opensource.nokia.com/projects/PAMP
51
Wednesday, November 3, 2010
Symfony Mobile
Mime-type based
optimisation
http://www.symfony-
project.org/blog/
2008/06/09/how-to-
create-an-optimized-
version-of-your-
website-for-the-iphone-
in-symfony-1-1
52
Wednesday, November 3, 2010
‘Lemon ADE’ AST editor
53
Wednesday, November 3, 2010
Resources for PHP/Mobile
http://www.egeniq.com/blog
http://mobile.phpmagazine.net/
http://thoomtech.com/iphone/
objc-for-php-developers-part-1/
54
Wednesday, November 3, 2010
Thank You
ivo@egeniq.com http://www.egeniq.com
@ijansch @egeniq
Please leave feedback at: http://joind.in/2254
55
Wednesday, November 3, 2010
Credits
Pictures used in this presentation are creative commons attribution licensed pictures.
Here are the owners and the URLS where the originals can be found:
‘Dow says POO’ by Stepleton - http://www.flickr.com/photos/29407923@N03/2899705638/
‘The telephone’ by Tylerdurden - http://www.flickr.com/photos/tylerdurden/529028040/
‘Web’ by Kurtxio - http://www.flickr.com/photos/kurtxio/2182760200/
‘Heavy cloud, no rain’ by Robynsnest - http://www.flickr.com/photos/robynsnest/12405841/
‘Wireless fridge’ from http://www.wirelessgoodness.com/tag/srt746awtn/
‘Army iphone app’ by Soldiersmediacenter - http://www.flickr.com/photos/soldiersmediacenter/4271795260/
‘Icon_safari_hires’ by Hans Dorsch - http://www.flickr.com/photos/hansdorsch/2861804087/
‘Thinking’ by Karola - http://www.flickr.com/photos/karola/3623768629/
‘Jus'a web’ by Jusfi - http://www.flickr.com/photos/jusfi/2921202536/
‘iPad :)’ by Korosirego - http://www.flickr.com/photos/korosirego/4334862666/
‘I've got a monkey on my back’ by Keven Law - http://www.flickr.com/photos/kevenlaw/2698946160/
‘Locked steel’ by Darwinbell - http://www.flickr.com/photos/darwinbell/321434733/
‘4 Biscuits’ by Barnoid - http://www.flickr.com/photos/barnoid/2025811494/
56
Wednesday, November 3, 2010

More Related Content

Viewers also liked (13)

PDF
PHP and the Cloud (phpbenelux conference)
Ivo Jansch
 
PPT
Teacher Bio
Colleen Graves
 
KEY
Blend it up - leancamp london presentation
Antonio Terreno
 
ODP
Artalk
Chiara Antonacci
 
PPT
Sv.jur 3.4.2011
Cirkev bratská Svätý Jur
 
PPT
Erd Summer Day Camp "Kids Games" Friday
Chris Johnson
 
PDF
Local government social media - lessons learnt
simonwakeman
 
PDF
Migrating from PHP4 To PHP5 - Zend Webinar
Ivo Jansch
 
PPT
There Is Always A Better Deal
Martin Finn
 
PPT
Rulang Cooling Robot
Kwan Tuck Soon
 
PPS
The Woman
Sharky
 
PPT
Vbase Google
havs
 
PPTX
Byť trpezliví jeden s druhým
Cirkev bratská Svätý Jur
 
PHP and the Cloud (phpbenelux conference)
Ivo Jansch
 
Teacher Bio
Colleen Graves
 
Blend it up - leancamp london presentation
Antonio Terreno
 
Erd Summer Day Camp "Kids Games" Friday
Chris Johnson
 
Local government social media - lessons learnt
simonwakeman
 
Migrating from PHP4 To PHP5 - Zend Webinar
Ivo Jansch
 
There Is Always A Better Deal
Martin Finn
 
Rulang Cooling Robot
Kwan Tuck Soon
 
The Woman
Sharky
 
Vbase Google
havs
 
Byť trpezliví jeden s druhým
Cirkev bratská Svätý Jur
 

Similar to PHP in a Mobile Ecosystem (Zendcon 2010) (20)

PDF
PHP in a mobile ecosystem
Ivo Jansch
 
PDF
Mobile for PHP developers
Ivo Jansch
 
PDF
Html5 Apps
Nikolai Onken
 
PDF
The Mobile Web Revealed For The Java Developer
balunasj
 
KEY
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
PDF
Building Cross Platform Mobile Web Apps
James Pearce
 
PDF
HTML5 and the dawn of rich mobile web applications
James Pearce
 
PDF
PhoneGap mobile development
Maximiliano Firtman
 
PDF
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
.toster
 
PDF
Nuxeo World Session: Mobile ECM Apps with Nuxeo EP
Nuxeo
 
PDF
Sencha Touch for Rubyists
James Pearce
 
PDF
Tek13 - Creating Mobile Apps with PHP and Symfony
Pablo Godel
 
PPTX
chapter2
Pon Tovave
 
PPTX
Mobile web development
Moumie Soulemane
 
KEY
Mobile ECM with JavaScript - JSE 2011
Nuxeo
 
PPTX
Here Today, Here Tomorrow: Mobile Devices - Northwestern University Web Steer...
Lee Roberson
 
KEY
Why Do Mobile Projects Fail?
Indiginox
 
PPTX
A Mobile Web Framework for the UC System
Brett Pollak
 
PPTX
Mobile applications for SharePoint using HTML5
Christian Heindel
 
PDF
Anatomy of an HTML 5 mobile web app
Ivano Malavolta
 
PHP in a mobile ecosystem
Ivo Jansch
 
Mobile for PHP developers
Ivo Jansch
 
Html5 Apps
Nikolai Onken
 
The Mobile Web Revealed For The Java Developer
balunasj
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
Building Cross Platform Mobile Web Apps
James Pearce
 
HTML5 and the dawn of rich mobile web applications
James Pearce
 
PhoneGap mobile development
Maximiliano Firtman
 
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
.toster
 
Nuxeo World Session: Mobile ECM Apps with Nuxeo EP
Nuxeo
 
Sencha Touch for Rubyists
James Pearce
 
Tek13 - Creating Mobile Apps with PHP and Symfony
Pablo Godel
 
chapter2
Pon Tovave
 
Mobile web development
Moumie Soulemane
 
Mobile ECM with JavaScript - JSE 2011
Nuxeo
 
Here Today, Here Tomorrow: Mobile Devices - Northwestern University Web Steer...
Lee Roberson
 
Why Do Mobile Projects Fail?
Indiginox
 
A Mobile Web Framework for the UC System
Brett Pollak
 
Mobile applications for SharePoint using HTML5
Christian Heindel
 
Anatomy of an HTML 5 mobile web app
Ivano Malavolta
 
Ad

More from Ivo Jansch (20)

PDF
Own Your Apps
Ivo Jansch
 
PDF
PHP Development In The Cloud (php|tek edition)
Ivo Jansch
 
PDF
Building an SSO platform in PHP (Zend Webinar Edition)
Ivo Jansch
 
PDF
The Business Case For Telecommuting
Ivo Jansch
 
PDF
Php Development In The Cloud
Ivo Jansch
 
PDF
27 Ways To Be A Better Developer (PHPBenelux 2011)
Ivo Jansch
 
PDF
Content Management Selection and Strategy
Ivo Jansch
 
PDF
PHP and the Cloud
Ivo Jansch
 
PDF
PHP in the Real World
Ivo Jansch
 
PDF
Dynamic Languages In The Enterprise (4developers march 2009)
Ivo Jansch
 
PDF
Enterprise PHP (php|works 2008)
Ivo Jansch
 
PDF
Enterprise PHP Development - ZendCon 2008
Ivo Jansch
 
PDF
Enterprise PHP Development (Dutch PHP Conference 2008)
Ivo Jansch
 
PDF
Hello Enterprise, my name is PHP
Ivo Jansch
 
PPT
Introduction to PHP (Casino Affiliate Convention 2008)
Ivo Jansch
 
PPT
Enterprise PHP (PHP London Conference 2008)
Ivo Jansch
 
PPT
Maatwerk Software
Ivo Jansch
 
PPT
Introductie Web 2.0
Ivo Jansch
 
PPT
Wat is Open Source?
Ivo Jansch
 
PPT
The i7 Framework for System-i
Ivo Jansch
 
Own Your Apps
Ivo Jansch
 
PHP Development In The Cloud (php|tek edition)
Ivo Jansch
 
Building an SSO platform in PHP (Zend Webinar Edition)
Ivo Jansch
 
The Business Case For Telecommuting
Ivo Jansch
 
Php Development In The Cloud
Ivo Jansch
 
27 Ways To Be A Better Developer (PHPBenelux 2011)
Ivo Jansch
 
Content Management Selection and Strategy
Ivo Jansch
 
PHP and the Cloud
Ivo Jansch
 
PHP in the Real World
Ivo Jansch
 
Dynamic Languages In The Enterprise (4developers march 2009)
Ivo Jansch
 
Enterprise PHP (php|works 2008)
Ivo Jansch
 
Enterprise PHP Development - ZendCon 2008
Ivo Jansch
 
Enterprise PHP Development (Dutch PHP Conference 2008)
Ivo Jansch
 
Hello Enterprise, my name is PHP
Ivo Jansch
 
Introduction to PHP (Casino Affiliate Convention 2008)
Ivo Jansch
 
Enterprise PHP (PHP London Conference 2008)
Ivo Jansch
 
Maatwerk Software
Ivo Jansch
 
Introductie Web 2.0
Ivo Jansch
 
Wat is Open Source?
Ivo Jansch
 
The i7 Framework for System-i
Ivo Jansch
 
Ad

Recently uploaded (20)

PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
How Current Advanced Cyber Threats Transform Business Operation
Eryk Budi Pratama
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
Machine Learning Benefits Across Industries
SynapseIndia
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Basics of Electronics for IOT(actuators ,microcontroller etc..)
arnavmanesh
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
PDF
SalesForce Managed Services Benefits (1).pdf
TechForce Services
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
How Current Advanced Cyber Threats Transform Business Operation
Eryk Budi Pratama
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Machine Learning Benefits Across Industries
SynapseIndia
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Basics of Electronics for IOT(actuators ,microcontroller etc..)
arnavmanesh
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
SalesForce Managed Services Benefits (1).pdf
TechForce Services
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 

PHP in a Mobile Ecosystem (Zendcon 2010)