Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building Desktop RIAs with JavaScript and PHP - ZendCon09


Published on

Web runtimes like Adobe AIR, Titanium and webOS open up interesting possibilities for web developers, allowing them to leverage their existing skills to develop desktop applications. Aimed at current PHP developers, this talk will focus on common web application technologies - PHP, HTML, Javascript - and explore how to utilize them to create desktop "Rich Internet Applications."

Published in: Technology
  • Be the first to comment

Building Desktop RIAs with JavaScript and PHP - ZendCon09

  1. 1. Building Desktop RIAs with PHP and JavaScript Ed Finkler • • @funkatron ZendCon 09 • #thistalksucks
  2. 2. What to expect This is mainly a JavaScript talk jQuery framework for JS examples But we talk about PHP on the server and the desktop, too This is mainly a desktop app dev talk Diffs between server app dev and desktop app dev Examples of desktop app <-> server app interaction
  3. 3. Web runtimes A browser engine environment used for building "local" apps
  4. 4. Current web runtimes AIR ( Desktop Titanium ( Desktop Mobile Palm webOS ( Mobile
  5. 5. We'll use AIR & Titanium But others bear examination
  6. 6. JavaScript on the Desktop Can use (almost) any available JS libs/frameworks No cross-domain restrictions security restrictions in app sandbox (AIR only)
  7. 7. Desktop vs Server-side PHP stack is built up/torn down every time mem leaks not much of an issue exec time < a few seconds max almost always synchronous calls Desktop apps are persistent exec time can be hours or days mem leaks a HUGE issue lots of asynchronous calls
  8. 8. JavaScript frameworks Some stuff in JS SUCKS without a framework Lots of choices
  9. 9. jQuery pwnz yoo jQuery is teh awesome (for some stuff) but you can use anything
  10. 10. PHP is your server-side buddy PHP tubby jedi master JavaScript hyper frontman Use 5.2 at least (you are, right?) adds native JSON encoding/decoding
  11. 11. PHP talking to JS Desktop Serve data structures instead of HTML Use JSON Use JSON USE JSON do not use XML (if you can avoid it) set the correct mime type (application/json)
  12. 12. Example 1: PHP duz yer math Async calls using jQuery AJAX methods Communicate via JSON Flash Zee Cloud web server Webkit
  13. 13. Example 2: PHP 'shops yer pics Uploading via Flash APIs JSON based communication Flash Zee Cloud web server Webkit
  14. 14. PHP & jQuery: THE UNHOLY UNION Only works in Titanium Desktop (0.7 or higher) Also doable with Ruby and Python PHP support in Titanium is still a work in progress
  15. 15. Additional resources Adobe AIR for JavaScript Developers Pocketguide Developing Adobe® AIR™ Applications with HTML and Ajax Titanium Titanium Forums Searchatron Source
  16. 16. Additional resources source Spaz Desktop Source Spaz webOS Source SpazCore
  17. 17. Questions? @funkatron • •