Building Desktop RIAs with PHP, HTML & Javascript in AIR

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Building Desktop RIAs with PHP, HTML & Javascript in AIR - Presentation Transcript

    1. Building Desktop RIAs with PHP, HTML & Javascript in AIR Ed Finkler, php|tek 2008, May 22 2008 funkatron.com / funkatron@gmail.com
    2. What is AIR? For the desktop Not a browser plugin Build desktop apps with web technologies
    3. AIR architecture A flash player + special AIR-specific APIs HTMLLoader control Uses WebKit – like Safari 3 Flash Zee Cloud OS web server Win/Mac/Linux Webkit (HTMLLoader)
    4. Building apps Flex (XML + Actionscript → SWF) Flash (the authoring tool → SWF) HTML (HTML + JS + CSS) open standards! just like regular web pages
    5. The bare essentials Application descriptor (.xml) Initial content (.swf or .html) If .html detected, auto-creates Flash wrapper with HTMLLoader control
    6. App descriptor <?xml version=\"1.0\" encoding=\"UTF-8\"?> <application xmlns=\"http://ns.adobe.com/air/application/1.0\"> <id>book.csv</id> <filename>Book-CSV</filename> <version>1.0.0</version> <initialWindow> <content>example-csv.html</content> <visible>true</visible> <width>400</width> <height>600</height> <x>100</x> <y>100</y> </initialWindow> </application>
    7. Initial content <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/> <title>csv-example</title> <script src=\"assets/AIRAliases.js\" type=\"text/javascript\" charset=\"utf-8\"></script> <script src=\"assets/AIRIntrospector.js\" type=\"text/javascript\" charset=\"utf-8\"></script> <script src=\"assets/jquery-1.2.3.js\" type=\"text/javascript\" charset=\"utf-8\"></script> <script src=\"assets/json2.js\" type=\"text/javascript\" charset=\"utf-8\"></script> <script src=\"assets/dojo/dojo/dojo.js\" type=\"text/javascript\" charset=\"utf-8\"></script> <script type=\"text/javascript\" charset=\"utf-8\"> $().ready( function() { var csvstring = ''; csvstring += '1997,Ford,E350,\"ac, abs, moon\",3000.00\\n'; csvstring += '1999,Chevy,\"Venture \"\"Extended Edition\"\"\",,4900.00\\n'; csvstring += '1996,Jeep,Grand Cherokee,\"MUST SELL! air, moon roof, loaded\",4799.00\\n'; $('#name').text(csvstring); }); </script> </head> <body> <textarea name=\"Name\" rows=\"8\" cols=\"80\" id=\"name\"></textarea> </body> </html>
    8. JavaScript in AIR Can use (almost) any available JS libs/frameworks No cross-domain restrictions security restrictions in app sandbox ( eval() ) Access AIR APIs Access standard Flash APIs Use compiled AS3 libs
    9. PHP vs JavaScript JavaScript is fundamentally different JS is a functional language functions are objects anon functions define functions inside functions Object model is totally different Prototype model – not “classic” Java/PHP5 model
    10. PHP vs JavaScript Everything in JS is an object Arrays are not associative – objects serve as associative array equivalents No include/require statements available Event-driven model/asynchronous actions Further reading: – JavaScript: The Definitive Guide, David Flanagan – JavaScript: The Good Parts, Douglas Crockford
    11. JavaScript frameworks Some stuff is a huge pain without the help of a framework Lots of choices Must play well with AIR eval usage
    12. jQuery pwnz yoo jQuery is teh awesome lightweight, powerful, terse (esp DOM) plays well with others easily extensible large dev community decent docs but you really can use almost anything…
    13. PHP is your server-side buddy PHP tubby jedi master AIR hyper frontman Use 5.2 at least adds native JSON encoding/decoding Framework choices
    14. Example 1: PHP duz yer math Async calls using jQuery AJAX methods Communicate via JSON Flash Zee Cloud web server Webkit
    15. Example 2: PHP shops yer pics Uploading via Flash APIs JSON based communication Flash Zee Cloud web server Webkit
    16. Additional resources Developing Adobe® AIR™ Applications with HTML and Ajax – http://livedocs.adobe.com/air/1/devappshtml/ Adobe AIR Developer Center for HTML and Ajax Quick Starts – http://www.adobe.com/devnet/air/ajax/ quickstart/ Spaz source code – http://code.google.com/p/spaz/
    17. Questions?

    + funkatronfunkatron, 2 years ago

    custom

    1826 views, 1 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1826
      • 1826 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 36
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories