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.

Like this presentation? Why not share!

Like this? Share it with your network

Share

Desktop Apps with PHP and Titanium (ZendCon 2010)

on

  • 6,285 views

Appcelerator Titanium is an open source platform for developing native desktop and mobile applications using the web technologies you're familiar with. Web developers can use their skills to develop ...

Appcelerator Titanium is an open source platform for developing native desktop and mobile applications using the web technologies you're familiar with. Web developers can use their skills to develop for both the Web and desktop/mobile apps. Ben Ramsey will demonstrate a simple application in Titanium Desktop, showing examples using JavaScript and PHP to power dynamic desktop applications.

Statistics

Views

Total Views
6,285
Views on SlideShare
6,229
Embed Views
56

Actions

Likes
1
Downloads
186
Comments
0

2 Embeds 56

http://www.berejeb.com 50
http://www.devetdesign.com 6

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Desktop Apps with PHP and Titanium (ZendCon 2010) Presentation Transcript

  • 1. Desktop Apps with PHP and Titanium Ben Ramsey • Zend/PHP Conference & Expo • 2 Nov 2010
  • 2. What Is Titanium?
  • 3. Four main parts… ‣ HTML/CSS/JavaScript ‣ APIs ‣ Language-OS bridge ‣ Run-time shell Desktop Apps with PHP and Titanium • Ben Ramsey 5
  • 4. $9M in funding from Sierra Ventures and eBay!
  • 5. Using Titanium Developer
  • 6. Installation on Linux ‣ There is a known issue with the GTK libraries for Titanium Developer on Linux ‣ Until there is a fix, do this after installing Titanium Developer: ‣ cd ~/.titanium/runtime/linux/1.0.0 ‣ rm libgobject* libgthread* libglib* libgio* Desktop Apps with PHP and Titanium • Ben Ramsey 19
  • 7. “Hello, World!”
  • 8. <html> <head> <title>Hello, World!</title> </head> <body> <h1>Hello, World!</h1> </body> </html>
  • 9. var mainMenu = Titanium.UI.createMenu(); mainMenu.appendItem(Titanium.UI.createMenuItem("File")); var menu = Titanium.UI.createMenu(); menu.appendItem(Titanium.UI.createMenuItem("Quit", function() { if (confirm("Are you sure you want to quit?")) { Titanium.App.exit(); } })); mainMenu.getItemAt(0).setSubmenu(menu); Titanium.UI.currentWindow.menu = mainMenu;
  • 10. Titanium has APIs! ‣ API ‣ Media ‣ Analytics ‣ Network ‣ App ‣ Notification ‣ Codec ‣ Platform ‣ Database ‣ Process ‣ Desktop ‣ UI ‣ Filesystem ‣ UpdateManager ‣ JSON ‣ Worker Desktop Apps with PHP and Titanium • Ben Ramsey 27
  • 11. PHP in Titanium
  • 12. <script type="text/php"> // PHP code goes here </script>
  • 13. <script type="text/javascript"> var heading = document.getElementById("title"); heading.innerHTML = "Hello, World!"; </script>
  • 14. <script type="text/php"> $heading = $document->getElementById("title"); $heading->innerHTML = "Hello, World!"; </script>
  • 15. <html> <head> <title>PHP Info</title> <script type="text/php"> date_default_timezone_set('America/Chicago'); ini_set('default_charset', 'utf8'); ini_set('display_errors', 'Off'); function getPhpInfo() { ob_start(); phpinfo(); return ob_get_clean(); } </script> </head> <body style="background-color: white; padding: 10px;"> <script type="text/php"> $document->write('<pre>' . getPhpInfo() . '</pre>'); </script> </body> </html>
  • 16. PHP caveats ‣ echo does not work as expected ‣ Titanium state transitions (links) do not send requests ‣ Pre-processed scripts (.php) are processed at compile/build time ‣ Cannot inject classes defined in .php into runtime code with include/ require Desktop Apps with PHP and Titanium • Ben Ramsey 36
  • 17. The client-server relationship does not exist.
  • 18. Planet PHP Demo
  • 19. Wrapping up…
  • 20. Questions? ‣ I blog at benramsey.com. ‣ I tweet at @ramsey. ‣ Please rate this presentation at joind.in/2259. ‣ Get the source code for my examples at GitHub. ‣ Find out more about Titanium at appcelerator.com. ‣ My company is Moontoast. Check us out at moontoast.com. Follow us on Twitter and like us on Facebook. Desktop Apps with PHP and Titanium • Ben Ramsey 40
  • 21. Desktop Apps with PHP and Titanium Copyright © 2010 Ben Ramsey. Some rights reserved. Presented on November 2, 2010 at Zend/PHP Conference and Expo, Hyatt Regency Hotel, Santa Clara, CA. This work is licensed under a Creative Commons Attribution- Noncommercial-No Derivative Works 3.0 United States License. For uses not covered under this license, please contact the author.
  • 22. Photo Credits ‣ Titan-crystal bar from Wikimedia Commons ‣ Titanium-cylinder from Wikimedia Commons ‣ Apollo 17 full Earth photograph from NASA/Goddard Space Flight Center Scientific Visualization Studio ‣ titanium cylinder, GRADE 2 quality from Wikimedia Commons ‣ Surface of a compressed cylinder of titanium from High-Res Images of Chemical Elements ‣ Guggenheim Museum Bilbao from Wikimedia Commons Desktop Apps with PHP and Titanium • Ben Ramsey 42