SlideShare a Scribd company logo
PHP in a Mobile Ecosystem
Ivo Jansch
January 28, 2011 - PHPBenelux Conference
About Egeniq
Startup
Mobile
Tech
Knowledge
Geeks
Development
About Me

@ijansch
Developer
Author
Entreprenerd
PHP
Part 1
Let’s think about mobile for a few minutes
The Web
is increasingly portable
It’s revolutionary


            Much like when
            the phone lost
            its wall socket
The Internet Of Things
ivo-imac:~ ivo$ ping fridge
PING fridge (192.168.1.138): 56 data bytes
The Web versus The Internet
Usage Characteristics
On the go
Short attention span
Avoid typing
To the point / ad hoc
Omnipresent
Context Awareness
‘Pocket Essentials’
Usage - ‘Couch Computing’

Relaxed
Freedom
Consumption
Convergence
Companion
Mobile Technologies

Objective-C (iPhone, iPad, iPod Touch, Apple TV)
Java (Android, Blackberry, Symbian)
HTML5 / Javascript (Any)
PHP (Any)
The App vs. The Browser
Browser based applications

Write once, run anywhere
Online
Requires browser
Page based
‘Stateless’
Native Apps
On- and offline
Event based
Native device experience
Convenient access to device features
Stateful
Monetization through App Stores
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
Predictions
Part 2
Browser Based Mobile Apps
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
Device Detection
Device Detection
http://detectmobilebrowsers.mobi/
  Downloadable PHP library
  for device detection
  Online code generator
  Donationware
  Ugly code, well documented
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/
Device Detection

Considerations:
  Don’t redirect to homepage
  Offer ‘classic’ option
  Don’t make assumptions on screen size
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
layouts/scripts/layout_mobile.phtml
views_mobile/scripts/index/index.phtml
Bootstrap.php
Result




Try it at http://egeniq.com/demo/zf/public
Zend_Http_UserAgent

New in Zend Framework 1.11
Can work with WURFL or Device Atlas
UI Design

Hover = evil
‘Finger Friendly Design’
‘Touch Driven Development’
Screens are getting bigger and (!) smaller
Scalable websites




http://www.niemanlab.org/2010/09/nyts-opinion-pages-continue-the-march-toward-
app-inspired-design/
HTML5 is easy


<!doctype html> - period.
<script> or <style> - period.
Semantics: header, footer, section, article tags
HTML5 is powerful
localStorage
<video>
<canvas>
<svg>
<input type=”number”> and many other form fields
 navigator.geolocation.getCurrentPosition();
Browsers love HTML5
Browsers supporting HTML5:
 Firefox
 Safari
 Opera
 All the mobile browsers
 IE (sort of, no support for <article> until IE9)
Things to consider


 Don’t just scale the layout, scale content too
 Consider ‘scenario based content management’
jQTouch
jQTouch

iPhone experience in HTML5
http://jqtouch.com/
jQuery based
MIT License
Give it a try: http://jqtouch.com/preview/demos/main
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/
You already know PHP



Your PHP skills + HTML5 = easy mobile websites
Part 3
Native Apps
PHP’s role in native apps

     iPhone   Android   Blackberry
       App     App         App




                API
Optimize APIs for mobile

 Content optimization
 Scalability
 Longevity
 Security
 Client/Server considerations
Content Optimization

  Consider CPU and memory constraints
    Prefer JSON over XML
    Compress data
    Keep responses small
    But not too small (connection / routing overhead)
Scalability


 AppStore featured/top listings Slashdot effect
 Consider the 80/20 rule of app popularity though
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
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
API Security
 TLS/SSL
 Basic Auth
 OAuth? XAuth!
 PKI / TLSAuth
 Signed URLs:
   ?x=1&y=2
     &signature=hash(secret, time limit, params)
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
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
Part 4
Best of Both Worlds
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
Cross Compilers = Instant Coffee
Part 5
Random bits if time permits
Running PHP on the device

First: Why??!
PHP For Android (PFA)
  http://phpforandroid.net/
PAMP for Symbian
  http://wiki.opensource.nokia.com/projects/PAMP
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
‘Lemon ADE’ AST editor
Resources for PHP/Mobile


http://www.egeniq.com/blog
http://mobile.phpmagazine.net/
http://thoomtech.com/iphone/
objc-for-php-developers-part-1/
Thank You
ivo@egeniq.com           http://www.egeniq.com
@ijansch                 @egeniq

Please leave feedback at: http://joind.in/2486
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/
   ‘Carbon Fibre Wallet’ by Ryan Loos - http://www.flickr.com/photos/rh1n0/4157547404/
   ‘Keys’ by Jamison Judd - http://www.flickr.com/photos/jamisonjudd/2419601050/
   ‘Phone Girl’ by Steffen - http://www.flickr.com/photos/re-ality/460465894/
   ‘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/
   ‘Add a spoonful of coffee’ by Martyn Wright - http://www.flickr.com/photos/35521221@N05/5181647830/
   ‘Locked steel’ by Darwinbell - http://www.flickr.com/photos/darwinbell/321434733/
   ‘4 Biscuits’ by Barnoid - http://www.flickr.com/photos/barnoid/2025811494/

More Related Content

PDF
Building an SSO platform in php (Zendcon 2010)
PPTX
Web android automation-Darshan Padmawar
PPTX
Code Camp - Presentation - Windows 10 - (Cortana)
PDF
Provisioning Profile
PPTX
Introduction to hybrid application development
PPTX
Introduction to Hybrid Application Development
PPT
Hybrid mobile app development
PPTX
Building Hybrid Apps with AngularJS and Ionic
Building an SSO platform in php (Zendcon 2010)
Web android automation-Darshan Padmawar
Code Camp - Presentation - Windows 10 - (Cortana)
Provisioning Profile
Introduction to hybrid application development
Introduction to Hybrid Application Development
Hybrid mobile app development
Building Hybrid Apps with AngularJS and Ionic

What's hot (20)

PDF
Appium
PPTX
Hybrid Mobile App
PPTX
Fire up your mobile app!
PDF
Appium Mobile Test Automation like WebDriver
PPTX
PPT from Webinar Create Hybrid Mobile Application in 1 hour
PPTX
Appium meet up noida
PPT
Android & iOS Automation Using Appium
PPTX
Microsoft Botframework and LUIS
PDF
Mobile Test Automation - Appium
PPTX
Appium - test automation for mobile apps
PPTX
Everything You Need To Know about Appium and Selenium
PPT
Using Selenium to Test Native Apps (Wait, you can do that?)
PPTX
Best Practices for Cross-Platform Native Applications
PDF
Hybrid mobile apps
PPTX
Intro to PhoneGap and PhoneGap Build
PPTX
Flex multi-screen development
PPTX
Appium overview (Selenium Israel #2, Feb. 2014)
PDF
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
PPT
PPTX
Digital Apps Development & Debugging
Appium
Hybrid Mobile App
Fire up your mobile app!
Appium Mobile Test Automation like WebDriver
PPT from Webinar Create Hybrid Mobile Application in 1 hour
Appium meet up noida
Android & iOS Automation Using Appium
Microsoft Botframework and LUIS
Mobile Test Automation - Appium
Appium - test automation for mobile apps
Everything You Need To Know about Appium and Selenium
Using Selenium to Test Native Apps (Wait, you can do that?)
Best Practices for Cross-Platform Native Applications
Hybrid mobile apps
Intro to PhoneGap and PhoneGap Build
Flex multi-screen development
Appium overview (Selenium Israel #2, Feb. 2014)
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
Digital Apps Development & Debugging
Ad

Viewers also liked (20)

PPTX
Ježiš v komunite
PDF
Interactions 12 Redux - Beyond the screen
PPT
Wat is Open Source?
PPT
Publizitatearen eta HHPP sarrera 3. Gaia
PPT
Get The Right Strategy
PPT
User Generated Content (Ugc)
PDF
Presentatie masterclass Lizzy Jongma
PPTX
How small charities can use the web to punch above their weight
PPS
PEK Spring Picnic 2007
PPT
Sv.Jur 18.10.2009
PDF
Enterprise2.0 기업 플랫폼의 변화
PPT
Snapshots Of The Trust Tree
PDF
我是产品经理我需不需要学技术
PPTX
在Sae上开发高性能微博应用
PPT
华文书展
PPTX
独特的荷兰风车
PPT
Publizitate Eraginkortasunaren Baliospena 4
PDF
HTML5 - Um Ano Depois
PPT
ICT Sustainability
Ježiš v komunite
Interactions 12 Redux - Beyond the screen
Wat is Open Source?
Publizitatearen eta HHPP sarrera 3. Gaia
Get The Right Strategy
User Generated Content (Ugc)
Presentatie masterclass Lizzy Jongma
How small charities can use the web to punch above their weight
PEK Spring Picnic 2007
Sv.Jur 18.10.2009
Enterprise2.0 기업 플랫폼의 변화
Snapshots Of The Trust Tree
我是产品经理我需不需要学技术
在Sae上开发高性能微博应用
华文书展
独特的荷兰风车
Publizitate Eraginkortasunaren Baliospena 4
HTML5 - Um Ano Depois
ICT Sustainability
Ad

Similar to PHP in a mobile ecosystem (20)

PPT
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
PPT
Best Practices in Mobile Development: Building Your First jQuery Mobile App
PPT
Building PHP Powered Android Applications
PDF
HTML5 Can't Do That
PPTX
HTML5: The Apps, the Frameworks, the Controversy
PPT
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
PDF
[D2대학생세미나] frontend개발자가 들려주는 개발 이야기
PPT
European SharePoint Conference: Mobile Applications for SharePoint using HTML5
PPTX
I like i phone and android but know .net
PDF
FEDM Meetup: Introducing Mojito
PPTX
Rhodes vs Phonegap
PPTX
Html5 for mobiles
PDF
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
PPTX
Food borne human diseases
PPT
Open Source to the Rescue of Mobile App and Mobile Web Fragmentation
PDF
Videogram - Building a product with Sencha Touch
PPS
Afik Gal @alphageeks: Flex Intro
PDF
Startup Technology: Cheatsheet for Non-Techies
PPTX
From desktop to mobile web
PPT
Lamp Zend Security
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
Best Practices in Mobile Development: Building Your First jQuery Mobile App
Building PHP Powered Android Applications
HTML5 Can't Do That
HTML5: The Apps, the Frameworks, the Controversy
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
[D2대학생세미나] frontend개발자가 들려주는 개발 이야기
European SharePoint Conference: Mobile Applications for SharePoint using HTML5
I like i phone and android but know .net
FEDM Meetup: Introducing Mojito
Rhodes vs Phonegap
Html5 for mobiles
HTML Hypermedia APIs and Adaptive Web Design - jDays 2013
Food borne human diseases
Open Source to the Rescue of Mobile App and Mobile Web Fragmentation
Videogram - Building a product with Sencha Touch
Afik Gal @alphageeks: Flex Intro
Startup Technology: Cheatsheet for Non-Techies
From desktop to mobile web
Lamp Zend Security

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
PHP in a Mobile Ecosystem (Zendcon 2010)
PDF
PHP and the Cloud (phpbenelux conference)
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
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)
PHP in a Mobile Ecosystem (Zendcon 2010)
PHP and the Cloud (phpbenelux conference)
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

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Machine Learning_overview_presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
cuic standard and advanced reporting.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Building Integrated photovoltaic BIPV_UPV.pdf
Machine Learning_overview_presentation.pptx
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Electronic commerce courselecture one. Pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
20250228 LYD VKU AI Blended-Learning.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
Digital-Transformation-Roadmap-for-Companies.pptx
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
sap open course for s4hana steps from ECC to s4
Empathic Computing: Creating Shared Understanding

PHP in a mobile ecosystem