SlideShare a Scribd company logo
1 of 23
Download to read offline
Mobile hybrid development with WordPress

     Saturday November 24th, 2012
             Bologna, Italy
WordPress.com Reader
•   WordPress.com has introduced a blog reader feature
    that’s a cross between Google Reader and reader
    apps like Flipboard. Through it you can keep track of
    blogs from WordPress.com, but also other places.
WordPress.com Reader
• The reader displays all the posts across
  all the blogs you follow in the order they
  were published, with the most recent
  content appearing at the top. You’ll see
  an excerpt of the introduction to each
  post, the first image in the post, and
  thumbnails of any other images that the
  post contains.
WordPress.com Reader
WordPress.com Reader



• A user can add any blog to the Reader
  by tapping the “Follow” button in the
  top admin bar while viewing the blog.
Introducing the mobile Reader
•   Read posts from blogs you’re following on
    WordPress.com right in the mobile apps,
    with the addition of social actions, such as
    ‘like’, ‘reblog’, ‘in-line commenting’, and
    more.

•   We wanted to add this new feature on all of
    our mobile apps (Android, iOS, BlackBerry,
    Windows Phone), trying to reuse the same
    codebase as much as possible.
Requirements
•   The content should be available as soon as
    the user clicks on the button. No lags, no
    long loading time. (If your app takes too long
    loading data, the user will probably switch to
    another task).

•   Access device native features such as
    sounds, native pull-to-refresh, blog
    preferences stored in the app.

•   Native or Hybrid ? -> We tried the Hybrid way
Hybrid Mobile Apps
•   A hybrid app is a native, downloadable app, that runs
    all or some of its UI in an embedded browser
    component.

•   HTML / CSS / JavaScript.

•   Hybrid apps can access device features such as file-
    system, cameras and geolocation services.

•   Frameworks, such as the open source project
    ‘Apache Cordova’, make the development of hybrid
    apps portable across devices, and allow developer to
    access native device features from one common JS
    API.
Loading the Reader
•   Clients authenticate on startup and keep track of the WP
    auth cookie. ( An alternative way is to use the
    WordPress.com login form and the redirect_to parameter,
    but it’s slower ).

•   The target of the redirect ( The URL of the Reader ) is
    something like https://wordpress.com/reader/mobile/v2/

•   We’ve added a filter on ‘page_template’, and the server
    outputs a simple HTML5 page.

•   The home page is a template that loads the required CSS
    and JS files.

•   Ajax calls to load the content of the reader. Those calls
    will start when the home page is fully loaded on the client.
[
              Example of server response
{
	   "fp_bg_image" : "http://s2.wp.com/imgpress?w=310&url=http%3A%2F%2Faphs.worldnomads.com
%2FOffTheBeatenPath%2F22448%2FiStock_000003676011Small.jpg&unsharpmask=80,0.5,3",
	   "avatar" : "http://en.wordpress.com/wp-content/themes/h4/i/mobile/subs-rss-mobile.png?
cached",
	   "author_name" : "Tim",
	   "author_avatar" : "http://1.gravatar.com/avatar/a4797cc25c5fe8922fc81c7d16e17bd8?s=64&d=http
%3A%2F%2F0.gravatar.com%2Fblavatar%2F0ef9c8d9ca53dd718d",
	   "title" : "I Donu2019t Enjoy the Ride",
	   "content" : "<p><img class="alignright" title="Road Trip" alt="" src="http://s0.wp.com/
imgpress?url=http%3A%2F%2Faphs.worldnomads.com%2FOffTheB>....",
	   "excerpt" : "<div class="full">..../div>...",
	   "post_id" : 185,
	   "guid" : "http://narrativeodyssey.com/?p=185",
	   "permalink" : "http://narrativeodyssey.com/2012/11/17/i-dont-enjoy-the-ride/",
	   "blog_id" : "35445524",
	   "blog" : "my narrative odyssey",
	   "blogurl" : "http://narrativeodyssey.wordpress.com",
	   "ts" : 1353217713,
	   "comment_count" : 0,
	   "pluralized_comment" : "Comments",
	   "ago" : "1d",
    ...
	   "follow_url" : "http://wordpress.com/following?b=00&amp;_wpnonce=not_in_the_house_XXdd5a200",
	   "unfollow_url" : "http://wordpress.com/following?b=00&amp;unsub=1&amp;_wpnonce=not_in_the_hous",
	   "following" : 0
},
How it looks on different devices

 The same experience on
Android and iOS. A little bit
     different on BB.
How it looks on different devices




BlackBerry with Keyboard   iPhone4
How it looks on different devices : Topics
                   Selector




BlackBerry with Keyboard          iPhone4
How it looks on different devices : Comment
                      Form




BlackBerry with Keyboard         iPhone4
JS Libraries used
• FitVids.js - A lightweight, easy-to-use
  jQuery plugin for fluid width video
  embeds.

• {{ mustache }} - Templating
• Two internal libraries for UA detection
  and capabilities detection.
Communication between JS and Native code

   • We’ve written a “bridge” that simplies the
     communication between the JS layer and
     the native code (and vice versa).

   • The bridge also adds some security
     checks to prevent malicious pages from
     executing native methods.
Issues found
•   Excessive stuttering when scrolling the posts list with
    images on it (Old versions of Android).

•   On the iPhone4 there were issues scrolling the lists
    due to missing optimizations for the UIWebView, and
    the absence of the Nitro JS Engine.

•   We did a lot of optimizations, but the scrolling is fast
    on iPhone 4S, not on the iPhone4.

•   BlackBerry 7 browser is very slow at rendering
    complex pages.

•   Windows Phone 7 doesn’t support HTML5 so we
    skipped that platform for now.
Performance Improvements (1)
CACHE:
# JS
/wp-includes/js/jquery/jquery.js
..

# CSS
/wp-content/themes/nomoreplasticthree/mobile/v2/reader.css
..

# images from the CSS
/wp-content/themes/nomoreplasticthree/i/mobile/v2/read.png
/wp-content/themes/nomoreplasticthree/i/mobile/v2/read@2x.png
...

# All other content accessed over the Network
NETWORK:
/wp-admin/admin-ajax.php*
*
http://*
https://*
Performance Improvements (2)
•   Use of localStorage to store the JSON response(s),
    and make them available without accessing the net.

•   JS time-diff to update the content without reloading it
    from the network.

•   Images are replaced with a smaller version server-
    side. Full version will be downloaded later, on
    demand, with a simple JS code. (This is possible
    thanks to the .COM ImagePress API).

    http://s0.wp.com/imgpress?url=http%3A%2F
    %2Fdigilander.libero.it%2Frondine_spensierata
    %2FUomoVetriRottiMare.jpg&h=150
The Future: REST API + Native
  • REST API opens access to posts,
    comments, follow, like and more.

  • http://developer.wordpress.com
  • Available on WordPress.com, and on
    Jetpack powered sites.

  • Should be available in WordPress Core
    in the future.
WordPress mobile apps
WordPress Mobile
http://make.wordpress.org/mobile


App specific development blogs with links to code testing info:

•   WordPress for Android
    http://dev.android.wordpress.org/

•   WordPress for BlackBerry
    http://dev.blackberry.wordpress.org/

•   WordPress for iOS
    http://iphonedev.wordpress.org/

•   WordPress for Windows Phone
    http://wpwindowsphonedev.wordpress.org/
Thanks ! Questions ?
Danilo Ercoli
Mobile Wrangler
http://daniloercoli.wordpress.com
http://twitter.com/daniloercoli
GeneralMobile Hybrid Development with WordPress

More Related Content

What's hot

How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsSingsys Pte Ltd
 
CUST-10 Customizing the Upload File(s) dialog in Alfresco Share
CUST-10 Customizing the Upload File(s) dialog in Alfresco ShareCUST-10 Customizing the Upload File(s) dialog in Alfresco Share
CUST-10 Customizing the Upload File(s) dialog in Alfresco ShareAlfresco Software
 
Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09mihaiionescu
 
WordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manuallyWordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manuallyBalaji kaliamoorthy
 
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!Serdar Basegmez
 
Installing wordpress
Installing wordpressInstalling wordpress
Installing wordpressDave Wallace
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu
 
SynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia
 
WordPress London - Favourite Plugins - March 2012
WordPress London - Favourite Plugins - March 2012WordPress London - Favourite Plugins - March 2012
WordPress London - Favourite Plugins - March 2012Graham Armfield
 
Content Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme developmentContent Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme developmentDave Wallace
 
WordPress vs Joomla Showdown
WordPress vs Joomla ShowdownWordPress vs Joomla Showdown
WordPress vs Joomla ShowdownPhelan Riessen
 
From Wordpress.com to Self-hosted
From Wordpress.com to Self-hostedFrom Wordpress.com to Self-hosted
From Wordpress.com to Self-hostedLuiza Libardi
 
Anatomy of a Wordpress theme
Anatomy of a Wordpress themeAnatomy of a Wordpress theme
Anatomy of a Wordpress themeDave Wallace
 
Introduction To WordPress
Introduction To WordPressIntroduction To WordPress
Introduction To WordPressNaeem Junejo
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 

What's hot (20)

How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy Steps
 
CUST-10 Customizing the Upload File(s) dialog in Alfresco Share
CUST-10 Customizing the Upload File(s) dialog in Alfresco ShareCUST-10 Customizing the Upload File(s) dialog in Alfresco Share
CUST-10 Customizing the Upload File(s) dialog in Alfresco Share
 
Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09Google Chrome Extensions - DevFest09
Google Chrome Extensions - DevFest09
 
WordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manuallyWordPress Installation Tutorial - How to Install WordPress manually
WordPress Installation Tutorial - How to Install WordPress manually
 
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
Engage 2015 - 10 Mistakes You and Every XPages Developer Make. Yes, I said YOU!
 
Installing wordpress
Installing wordpressInstalling wordpress
Installing wordpress
 
Alice Phieu - WordPress For Beginners
Alice Phieu - WordPress For BeginnersAlice Phieu - WordPress For Beginners
Alice Phieu - WordPress For Beginners
 
SynapseIndia wordpress installation training module
SynapseIndia wordpress installation training moduleSynapseIndia wordpress installation training module
SynapseIndia wordpress installation training module
 
WordPress London - Favourite Plugins - March 2012
WordPress London - Favourite Plugins - March 2012WordPress London - Favourite Plugins - March 2012
WordPress London - Favourite Plugins - March 2012
 
Content Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme developmentContent Management Systems (CMS) & Wordpress theme development
Content Management Systems (CMS) & Wordpress theme development
 
WordPress vs Joomla Showdown
WordPress vs Joomla ShowdownWordPress vs Joomla Showdown
WordPress vs Joomla Showdown
 
Wordpress overview
Wordpress overviewWordpress overview
Wordpress overview
 
Wordpress
WordpressWordpress
Wordpress
 
From Wordpress.com to Self-hosted
From Wordpress.com to Self-hostedFrom Wordpress.com to Self-hosted
From Wordpress.com to Self-hosted
 
Anatomy of a Wordpress theme
Anatomy of a Wordpress themeAnatomy of a Wordpress theme
Anatomy of a Wordpress theme
 
BlackBerry WebWorks
BlackBerry WebWorksBlackBerry WebWorks
BlackBerry WebWorks
 
Introduction To WordPress
Introduction To WordPressIntroduction To WordPress
Introduction To WordPress
 
Wordpress
WordpressWordpress
Wordpress
 
Beginning WordPress
Beginning WordPressBeginning WordPress
Beginning WordPress
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 

Viewers also liked

Let's Build a Custom Theme
Let's Build a Custom ThemeLet's Build a Custom Theme
Let's Build a Custom ThemeAndy Stratton
 
"Which WordPress Job Is Right For You?" WordCamp Orange County 2015
"Which WordPress Job Is Right For You?" WordCamp Orange County 2015"Which WordPress Job Is Right For You?" WordCamp Orange County 2015
"Which WordPress Job Is Right For You?" WordCamp Orange County 2015Suzette Franck
 
WCSTL 2014 - Powerful Deployments
WCSTL 2014 - Powerful DeploymentsWCSTL 2014 - Powerful Deployments
WCSTL 2014 - Powerful DeploymentsMyke Bates
 
Why we publish -- WordCamp Birmingham 2014
Why we publish -- WordCamp Birmingham 2014Why we publish -- WordCamp Birmingham 2014
Why we publish -- WordCamp Birmingham 2014Brian Krogsgard
 
Wordpress Plugin Development Practices
Wordpress Plugin Development PracticesWordpress Plugin Development Practices
Wordpress Plugin Development Practicesserversideup
 
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV GGDBologna
 
WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011Shayne Sanderson
 
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...Kick Point
 
WordPress in a Time of Crisis
WordPress in a Time of CrisisWordPress in a Time of Crisis
WordPress in a Time of CrisisMichelle Amaral
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
 
Open Source Entrepreneurship
Open Source EntrepreneurshipOpen Source Entrepreneurship
Open Source EntrepreneurshipJimmy Rosén
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescueMarko Heijnen
 
Wordcamp Edmonton - Slides
Wordcamp Edmonton - SlidesWordcamp Edmonton - Slides
Wordcamp Edmonton - SlidesNick Coe
 
My first 3 months working with word press
My first 3 months working with word pressMy first 3 months working with word press
My first 3 months working with word pressNoe Lopez
 
Options, and Transients, and Theme Mods — Oh my!
Options, and Transients, and Theme Mods — Oh my!Options, and Transients, and Theme Mods — Oh my!
Options, and Transients, and Theme Mods — Oh my!Konstantin Obenland
 
Working with WP_Query in WordPress
Working with WP_Query in WordPressWorking with WP_Query in WordPress
Working with WP_Query in WordPresstopher1kenobe
 
Wc norrkoping-2015
Wc norrkoping-2015Wc norrkoping-2015
Wc norrkoping-2015pelmered
 
SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)Ian Castro
 
Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)Teresa Lane
 

Viewers also liked (20)

Let's Build a Custom Theme
Let's Build a Custom ThemeLet's Build a Custom Theme
Let's Build a Custom Theme
 
"Which WordPress Job Is Right For You?" WordCamp Orange County 2015
"Which WordPress Job Is Right For You?" WordCamp Orange County 2015"Which WordPress Job Is Right For You?" WordCamp Orange County 2015
"Which WordPress Job Is Right For You?" WordCamp Orange County 2015
 
Content strategy wordcampnash2013
Content strategy wordcampnash2013Content strategy wordcampnash2013
Content strategy wordcampnash2013
 
WCSTL 2014 - Powerful Deployments
WCSTL 2014 - Powerful DeploymentsWCSTL 2014 - Powerful Deployments
WCSTL 2014 - Powerful Deployments
 
Why we publish -- WordCamp Birmingham 2014
Why we publish -- WordCamp Birmingham 2014Why we publish -- WordCamp Birmingham 2014
Why we publish -- WordCamp Birmingham 2014
 
Wordpress Plugin Development Practices
Wordpress Plugin Development PracticesWordpress Plugin Development Practices
Wordpress Plugin Development Practices
 
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
Responsività e integrazioni social: l’utente al centro nel nuovo sito Volvo TV
 
WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011WordPress & eCommerce - WCLV 2011
WordPress & eCommerce - WCLV 2011
 
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
Everything You Ever Wanted to Know About Keyword Research (And Probably a Few...
 
WordPress in a Time of Crisis
WordPress in a Time of CrisisWordPress in a Time of Crisis
WordPress in a Time of Crisis
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
 
Open Source Entrepreneurship
Open Source EntrepreneurshipOpen Source Entrepreneurship
Open Source Entrepreneurship
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
 
Wordcamp Edmonton - Slides
Wordcamp Edmonton - SlidesWordcamp Edmonton - Slides
Wordcamp Edmonton - Slides
 
My first 3 months working with word press
My first 3 months working with word pressMy first 3 months working with word press
My first 3 months working with word press
 
Options, and Transients, and Theme Mods — Oh my!
Options, and Transients, and Theme Mods — Oh my!Options, and Transients, and Theme Mods — Oh my!
Options, and Transients, and Theme Mods — Oh my!
 
Working with WP_Query in WordPress
Working with WP_Query in WordPressWorking with WP_Query in WordPress
Working with WP_Query in WordPress
 
Wc norrkoping-2015
Wc norrkoping-2015Wc norrkoping-2015
Wc norrkoping-2015
 
SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)SEO para Wordpress (WordCamp Salvador)
SEO para Wordpress (WordCamp Salvador)
 
Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)Optimizing Content Visibility (St. Louis WordCamp)
Optimizing Content Visibility (St. Louis WordCamp)
 

Similar to GeneralMobile Hybrid Development with WordPress

Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesAndrew Ferrier
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps QuicklyGil Irizarry
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Ivano Malavolta
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache CordovaIvano Malavolta
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Gil Irizarry
 
Webdev battacherjee
Webdev battacherjeeWebdev battacherjee
Webdev battacherjeeRavingTiger
 
Intro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsIntro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsSasha dos Santos
 
Introduction to hybrid application development
Introduction to hybrid application developmentIntroduction to hybrid application development
Introduction to hybrid application developmentKunjan Thakkar
 
BeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-OrruBeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-OrruMichele Orru
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeededm00se
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
How to start developing apps for Firefox OS
How to start developing apps for Firefox OSHow to start developing apps for Firefox OS
How to start developing apps for Firefox OSbenko
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development LandscapeAmbert Ho
 
DIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development todayDIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development todayBojan Veljanovski
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptxNishchaiyaBayla1
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioMizanur Sarker
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPressPantheon
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 

Similar to GeneralMobile Hybrid Development with WordPress (20)

Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best Practices
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps Quickly
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache Cordova
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Webdev battacherjee
Webdev battacherjeeWebdev battacherjee
Webdev battacherjee
 
Intro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsIntro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile Applications
 
Introduction to hybrid application development
Introduction to hybrid application developmentIntroduction to hybrid application development
Introduction to hybrid application development
 
BeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-OrruBeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-Orru
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
How to start developing apps for Firefox OS
How to start developing apps for Firefox OSHow to start developing apps for Firefox OS
How to start developing apps for Firefox OS
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
 
DIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development todayDIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development today
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptx
 
Cross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual StudioCross-Platform Development using Angulr JS in Visual Studio
Cross-Platform Development using Angulr JS in Visual Studio
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPress
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
Chapter3 mo
Chapter3 moChapter3 mo
Chapter3 mo
 

More from GGDBologna

Presentazione ggd bologna
Presentazione ggd bolognaPresentazione ggd bologna
Presentazione ggd bolognaGGDBologna
 
Creare un tema personalizzato per wordpress
Creare un tema personalizzato per wordpressCreare un tema personalizzato per wordpress
Creare un tema personalizzato per wordpressGGDBologna
 
Miglioriamo le performance di wordpress
Miglioriamo le performance di wordpress Miglioriamo le performance di wordpress
Miglioriamo le performance di wordpress GGDBologna
 
L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...
L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...
L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...GGDBologna
 
WordPress per giornalisti freelance
WordPress per giornalisti freelance  WordPress per giornalisti freelance
WordPress per giornalisti freelance GGDBologna
 
Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress? Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress? GGDBologna
 
L’uso di WordPress nella comunicazione corporate di Telecom Italia
L’uso di WordPress nella comunicazione corporate di Telecom Italia L’uso di WordPress nella comunicazione corporate di Telecom Italia
L’uso di WordPress nella comunicazione corporate di Telecom Italia GGDBologna
 
Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti
Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti
Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti GGDBologna
 
Realizzare una intranet aziendale con wordpress
Realizzare una intranet aziendale con wordpressRealizzare una intranet aziendale con wordpress
Realizzare una intranet aziendale con wordpressGGDBologna
 
Word Press Starter Kit: Widget & Plugin
Word Press Starter Kit: Widget  & PluginWord Press Starter Kit: Widget  & Plugin
Word Press Starter Kit: Widget & PluginGGDBologna
 
Introducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystemIntroducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystemGGDBologna
 
Mba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischerMba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischerGGDBologna
 
Mba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischerMba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischerGGDBologna
 
Il mondo di twitter
Il mondo di twitterIl mondo di twitter
Il mondo di twitterGGDBologna
 
West women in stem
West women in stem West women in stem
West women in stem GGDBologna
 
GGDBologna: Presentazione
GGDBologna: PresentazioneGGDBologna: Presentazione
GGDBologna: PresentazioneGGDBologna
 
GGDBologna11: Flavia Marzano
GGDBologna11: Flavia MarzanoGGDBologna11: Flavia Marzano
GGDBologna11: Flavia MarzanoGGDBologna
 
GGDBologna11: Antonella Napolitano
GGDBologna11: Antonella NapolitanoGGDBologna11: Antonella Napolitano
GGDBologna11: Antonella NapolitanoGGDBologna
 
Organizzare un evento on-line e aver successo
Organizzare un evento on-line e aver successoOrganizzare un evento on-line e aver successo
Organizzare un evento on-line e aver successoGGDBologna
 
Francesca Minonne: GRAN TORINO 2.0
Francesca Minonne: GRAN TORINO 2.0Francesca Minonne: GRAN TORINO 2.0
Francesca Minonne: GRAN TORINO 2.0GGDBologna
 

More from GGDBologna (20)

Presentazione ggd bologna
Presentazione ggd bolognaPresentazione ggd bologna
Presentazione ggd bologna
 
Creare un tema personalizzato per wordpress
Creare un tema personalizzato per wordpressCreare un tema personalizzato per wordpress
Creare un tema personalizzato per wordpress
 
Miglioriamo le performance di wordpress
Miglioriamo le performance di wordpress Miglioriamo le performance di wordpress
Miglioriamo le performance di wordpress
 
L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...
L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...
L’ascesa della geolocalizzazione. Perché mapperemo sempre di più e come lo fa...
 
WordPress per giornalisti freelance
WordPress per giornalisti freelance  WordPress per giornalisti freelance
WordPress per giornalisti freelance
 
Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress? Quanto è sicuro il tuo wordpress?
Quanto è sicuro il tuo wordpress?
 
L’uso di WordPress nella comunicazione corporate di Telecom Italia
L’uso di WordPress nella comunicazione corporate di Telecom Italia L’uso di WordPress nella comunicazione corporate di Telecom Italia
L’uso di WordPress nella comunicazione corporate di Telecom Italia
 
Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti
Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti
Un blog per la scuola Dozza: il progetto Dozzilla e i suoi protagonisti
 
Realizzare una intranet aziendale con wordpress
Realizzare una intranet aziendale con wordpressRealizzare una intranet aziendale con wordpress
Realizzare una intranet aziendale con wordpress
 
Word Press Starter Kit: Widget & Plugin
Word Press Starter Kit: Widget  & PluginWord Press Starter Kit: Widget  & Plugin
Word Press Starter Kit: Widget & Plugin
 
Introducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystemIntroducing the wpXtreme ecosystem
Introducing the wpXtreme ecosystem
 
Mba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischerMba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischer
 
Mba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischerMba class 2012 2013-i.fischer
Mba class 2012 2013-i.fischer
 
Il mondo di twitter
Il mondo di twitterIl mondo di twitter
Il mondo di twitter
 
West women in stem
West women in stem West women in stem
West women in stem
 
GGDBologna: Presentazione
GGDBologna: PresentazioneGGDBologna: Presentazione
GGDBologna: Presentazione
 
GGDBologna11: Flavia Marzano
GGDBologna11: Flavia MarzanoGGDBologna11: Flavia Marzano
GGDBologna11: Flavia Marzano
 
GGDBologna11: Antonella Napolitano
GGDBologna11: Antonella NapolitanoGGDBologna11: Antonella Napolitano
GGDBologna11: Antonella Napolitano
 
Organizzare un evento on-line e aver successo
Organizzare un evento on-line e aver successoOrganizzare un evento on-line e aver successo
Organizzare un evento on-line e aver successo
 
Francesca Minonne: GRAN TORINO 2.0
Francesca Minonne: GRAN TORINO 2.0Francesca Minonne: GRAN TORINO 2.0
Francesca Minonne: GRAN TORINO 2.0
 

GeneralMobile Hybrid Development with WordPress

  • 1. Mobile hybrid development with WordPress Saturday November 24th, 2012 Bologna, Italy
  • 2. WordPress.com Reader • WordPress.com has introduced a blog reader feature that’s a cross between Google Reader and reader apps like Flipboard. Through it you can keep track of blogs from WordPress.com, but also other places.
  • 3. WordPress.com Reader • The reader displays all the posts across all the blogs you follow in the order they were published, with the most recent content appearing at the top. You’ll see an excerpt of the introduction to each post, the first image in the post, and thumbnails of any other images that the post contains.
  • 5. WordPress.com Reader • A user can add any blog to the Reader by tapping the “Follow” button in the top admin bar while viewing the blog.
  • 6. Introducing the mobile Reader • Read posts from blogs you’re following on WordPress.com right in the mobile apps, with the addition of social actions, such as ‘like’, ‘reblog’, ‘in-line commenting’, and more. • We wanted to add this new feature on all of our mobile apps (Android, iOS, BlackBerry, Windows Phone), trying to reuse the same codebase as much as possible.
  • 7. Requirements • The content should be available as soon as the user clicks on the button. No lags, no long loading time. (If your app takes too long loading data, the user will probably switch to another task). • Access device native features such as sounds, native pull-to-refresh, blog preferences stored in the app. • Native or Hybrid ? -> We tried the Hybrid way
  • 8. Hybrid Mobile Apps • A hybrid app is a native, downloadable app, that runs all or some of its UI in an embedded browser component. • HTML / CSS / JavaScript. • Hybrid apps can access device features such as file- system, cameras and geolocation services. • Frameworks, such as the open source project ‘Apache Cordova’, make the development of hybrid apps portable across devices, and allow developer to access native device features from one common JS API.
  • 9. Loading the Reader • Clients authenticate on startup and keep track of the WP auth cookie. ( An alternative way is to use the WordPress.com login form and the redirect_to parameter, but it’s slower ). • The target of the redirect ( The URL of the Reader ) is something like https://wordpress.com/reader/mobile/v2/ • We’ve added a filter on ‘page_template’, and the server outputs a simple HTML5 page. • The home page is a template that loads the required CSS and JS files. • Ajax calls to load the content of the reader. Those calls will start when the home page is fully loaded on the client.
  • 10. [ Example of server response { "fp_bg_image" : "http://s2.wp.com/imgpress?w=310&#038;url=http%3A%2F%2Faphs.worldnomads.com %2FOffTheBeatenPath%2F22448%2FiStock_000003676011Small.jpg&#038;unsharpmask=80,0.5,3", "avatar" : "http://en.wordpress.com/wp-content/themes/h4/i/mobile/subs-rss-mobile.png? cached", "author_name" : "Tim", "author_avatar" : "http://1.gravatar.com/avatar/a4797cc25c5fe8922fc81c7d16e17bd8?s=64&amp;d=http %3A%2F%2F0.gravatar.com%2Fblavatar%2F0ef9c8d9ca53dd718d", "title" : "I Donu2019t Enjoy the Ride", "content" : "<p><img class="alignright" title="Road Trip" alt="" src="http://s0.wp.com/ imgpress?url=http%3A%2F%2Faphs.worldnomads.com%2FOffTheB>....", "excerpt" : "<div class="full">..../div>...", "post_id" : 185, "guid" : "http://narrativeodyssey.com/?p=185", "permalink" : "http://narrativeodyssey.com/2012/11/17/i-dont-enjoy-the-ride/", "blog_id" : "35445524", "blog" : "my narrative odyssey", "blogurl" : "http://narrativeodyssey.wordpress.com", "ts" : 1353217713, "comment_count" : 0, "pluralized_comment" : "Comments", "ago" : "1d", ... "follow_url" : "http://wordpress.com/following?b=00&amp;_wpnonce=not_in_the_house_XXdd5a200", "unfollow_url" : "http://wordpress.com/following?b=00&amp;unsub=1&amp;_wpnonce=not_in_the_hous", "following" : 0 },
  • 11. How it looks on different devices The same experience on Android and iOS. A little bit different on BB.
  • 12. How it looks on different devices BlackBerry with Keyboard iPhone4
  • 13. How it looks on different devices : Topics Selector BlackBerry with Keyboard iPhone4
  • 14. How it looks on different devices : Comment Form BlackBerry with Keyboard iPhone4
  • 15. JS Libraries used • FitVids.js - A lightweight, easy-to-use jQuery plugin for fluid width video embeds. • {{ mustache }} - Templating • Two internal libraries for UA detection and capabilities detection.
  • 16. Communication between JS and Native code • We’ve written a “bridge” that simplies the communication between the JS layer and the native code (and vice versa). • The bridge also adds some security checks to prevent malicious pages from executing native methods.
  • 17. Issues found • Excessive stuttering when scrolling the posts list with images on it (Old versions of Android). • On the iPhone4 there were issues scrolling the lists due to missing optimizations for the UIWebView, and the absence of the Nitro JS Engine. • We did a lot of optimizations, but the scrolling is fast on iPhone 4S, not on the iPhone4. • BlackBerry 7 browser is very slow at rendering complex pages. • Windows Phone 7 doesn’t support HTML5 so we skipped that platform for now.
  • 18. Performance Improvements (1) CACHE: # JS /wp-includes/js/jquery/jquery.js .. # CSS /wp-content/themes/nomoreplasticthree/mobile/v2/reader.css .. # images from the CSS /wp-content/themes/nomoreplasticthree/i/mobile/v2/read.png /wp-content/themes/nomoreplasticthree/i/mobile/v2/read@2x.png ... # All other content accessed over the Network NETWORK: /wp-admin/admin-ajax.php* * http://* https://*
  • 19. Performance Improvements (2) • Use of localStorage to store the JSON response(s), and make them available without accessing the net. • JS time-diff to update the content without reloading it from the network. • Images are replaced with a smaller version server- side. Full version will be downloaded later, on demand, with a simple JS code. (This is possible thanks to the .COM ImagePress API). http://s0.wp.com/imgpress?url=http%3A%2F %2Fdigilander.libero.it%2Frondine_spensierata %2FUomoVetriRottiMare.jpg&h=150
  • 20. The Future: REST API + Native • REST API opens access to posts, comments, follow, like and more. • http://developer.wordpress.com • Available on WordPress.com, and on Jetpack powered sites. • Should be available in WordPress Core in the future.
  • 21. WordPress mobile apps WordPress Mobile http://make.wordpress.org/mobile App specific development blogs with links to code testing info: • WordPress for Android http://dev.android.wordpress.org/ • WordPress for BlackBerry http://dev.blackberry.wordpress.org/ • WordPress for iOS http://iphonedev.wordpress.org/ • WordPress for Windows Phone http://wpwindowsphonedev.wordpress.org/
  • 22. Thanks ! Questions ? Danilo Ercoli Mobile Wrangler http://daniloercoli.wordpress.com http://twitter.com/daniloercoli