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

PDF
Strategies for securing your banks & enterprises (from someone who robs bank...
KEY
Falsy Values - Warsaw 2011
PDF
Building an SSO platform in php (Zendcon 2010)
PPTX
Asbury Hadoop Overview
PPT
Publizitate eta HHPP sarrera: 4. gaia
PPT
Presentation1
PPT
Biological Names Talk 01
PPT
NoSQL Oakland
Strategies for securing your banks & enterprises (from someone who robs bank...
Falsy Values - Warsaw 2011
Building an SSO platform in php (Zendcon 2010)
Asbury Hadoop Overview
Publizitate eta HHPP sarrera: 4. gaia
Presentation1
Biological Names Talk 01
NoSQL Oakland

Viewers also liked (13)

PDF
PHP and the Cloud (phpbenelux conference)
PPT
Teacher Bio
KEY
Blend it up - leancamp london presentation
ODP
PPT
PPT
Erd Summer Day Camp "Kids Games" Friday
PDF
Local government social media - lessons learnt
PDF
Migrating from PHP4 To PHP5 - Zend Webinar
PPT
There Is Always A Better Deal
PPT
Rulang Cooling Robot
PPS
The Woman
PPT
Vbase Google
PPTX
Byť trpezliví jeden s druhým
PHP and the Cloud (phpbenelux conference)
Teacher Bio
Blend it up - leancamp london presentation
Erd Summer Day Camp "Kids Games" Friday
Local government social media - lessons learnt
Migrating from PHP4 To PHP5 - Zend Webinar
There Is Always A Better Deal
Rulang Cooling Robot
The Woman
Vbase Google
Byť trpezliví jeden s druhým
Ad

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

PDF
PHP in a mobile ecosystem
PPT
Create Cross-Platform Native Mobile Apps in Flex with ELIPS Studio
PDF
Human APIs
PPTX
IE9 the story so far
PPT
Best Practices in Mobile Development: Building Your First jQuery Mobile App
PPTX
Stronger than Chuck Norris: SharePoint in clouds, on earth, in subway and in ...
PDF
HTML5 Apps - Mobile Developer Summit Bangalore
PDF
Web and browser evolution
PDF
PhoneGap Talk @ Sencha Con 2010
PDF
Webtech 17.11.2009
PDF
Apache mobilefilter 4-03
PPT
What's New with Windows Phone - FoxCon Talk
PDF
CodeMorphic at MinneWebCon 2010
PDF
Making your site mobile-friendly / RIT++
PDF
GWT♥HTML5
PDF
Building FirefoxOS apps with Clojurescript
PDF
Window Shopping Browser - Bug Hunting in 2012
PDF
Web rtc+webaudio
PPTX
Mobile First - Web & PHP Conference - 2013-09-17 Keynote
PPTX
An end-to-end experience of Windows Phone 7 development (Part 2)
PHP in a mobile ecosystem
Create Cross-Platform Native Mobile Apps in Flex with ELIPS Studio
Human APIs
IE9 the story so far
Best Practices in Mobile Development: Building Your First jQuery Mobile App
Stronger than Chuck Norris: SharePoint in clouds, on earth, in subway and in ...
HTML5 Apps - Mobile Developer Summit Bangalore
Web and browser evolution
PhoneGap Talk @ Sencha Con 2010
Webtech 17.11.2009
Apache mobilefilter 4-03
What's New with Windows Phone - FoxCon Talk
CodeMorphic at MinneWebCon 2010
Making your site mobile-friendly / RIT++
GWT♥HTML5
Building FirefoxOS apps with Clojurescript
Window Shopping Browser - Bug Hunting in 2012
Web rtc+webaudio
Mobile First - Web & PHP Conference - 2013-09-17 Keynote
An end-to-end experience of Windows Phone 7 development (Part 2)
Ad

More from Ivo Jansch (20)

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

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Electronic commerce courselecture one. Pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
Machine Learning_overview_presentation.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Assigned Numbers - 2025 - Bluetooth® Document
Electronic commerce courselecture one. Pdf
A comparative analysis of optical character recognition models for extracting...
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25-Week II
Building Integrated photovoltaic BIPV_UPV.pdf
Review of recent advances in non-invasive hemoglobin estimation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
sap open course for s4hana steps from ECC to s4
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

PHP in a Mobile Ecosystem (Zendcon 2010)