SlideShare a Scribd company logo
1 of 45
Download to read offline
Desktop Apps with
 PHP and Titanium
                Ben Ramsey
        TEK·X • May 19, 2010
Hi, I’m Ben.
benramsey.com
@ramsey
joind.in/1576
DISCLAIMER:




   I’m not a salesman
   & I don’t work for
   Appcelerator.
DISCLAIMER:




   I helped with the
   initial embedding of
   PHP in Titanium.
What is Titanium?
Four main parts of Titanium apps

   • The html/css/javascript code that makes
     up the core application logic and UI
   • The APIs that access native device/
     desktop functionality, analytics or other
     modular functionality
   • The language-OS bridge that compiles
     web code into native application code
   • The run-time shell that packages the
     application for cross-platform distribution
Contrasting with AIR...



   • Titanium is released under an open
     source license
   • Titanium provides access to native
     controls
   • Titanium applications are packaged for a
     target system: Windows, OS X, Linux
Who is
Appcelerator?
Appcelerator’s role



   • Developed and own’s Titanium source
   • Licenses Titanium under Apache license
   • Support, training, and consulting
   • Analytics and tracking
   • Infrastructure for building and packaging
     releases of your apps in the cloud
How Appcelerator makes money...
So, why PHP on
Titanium?
• Titanium already had modules to support
  Python and Ruby development
• PHP was on their roadmap
• PHP is a natural scripting complement to
  other web technologies
• It was cool and fun to do
• I can now build desktop apps with PHP
  without using PHP-GTK (no offense to
  the maintainers of PHP-GTK)
Using Titanium
Developer
• Fill out your application details
• Click “Create Project”
• Click the “Test & Package” tab
• Click the “Launch App” button
Now, you have code!
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*
“Hello, World.”
<html>
<head>
    <title>Hello, World!</title>
</head>
<body>
    <h1>Hello, World!</h1>
</body>
</html>
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;
Titanium provides APIs...

   •   API            •   Media

   •   Analytics      •   Network

   •   App            •   Notification

   •   Codec          •   Platform

   •   Database       •   Process

   •   Desktop        •   UI

   •   Filesystem     •   UpdateManager

   •   JSON           •   Worker
Drop in external libraries
Accessing these APIs and libraries




   • JavaScript
   • Python
   • Ruby
   • PHP
PHP in Titanium
<script type="text/php">
    // PHP code goes here
</script>
JavaScript




<script type="text/javascript">
    var heading = document.getElementById("title");
    heading.innerHTML = "Hello, World!";
</script>
PHP




<script type="text/php">
    $heading = $document->getElementById("title");
    $heading->innerHTML = "Hello, World!";
</script>
phpinfo()
<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>
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
Are some of these
bugs?

Maybe.
Planet PHP Demo
Wrapping up...

   • Titanium allows web developers the
     ability to create desktop apps
   • It builds native applications that you can
     distribute for a particular OS
   • You can combine PHP with JavaScript
     (and Python and Ruby) to leverage the
     best of each language
   • Still some bugs to iron out, but that’s why
     they need lots of people using it
Questions?
Thank you!
Ben Ramsey
benramsey.com
@ramsey
joind.in/1576


www.appcelerator.com
developer.appcelerator.com
#titanium_app on Freenode IRC

More Related Content

What's hot

Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsAdam Culp
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowPantheon
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Pantheon
 
Internet Explorer 9
Internet Explorer 9Internet Explorer 9
Internet Explorer 9pietrobr
 
Integração Contínua com PHPCI
Integração Contínua com PHPCIIntegração Contínua com PHPCI
Integração Contínua com PHPCIThiago Paes
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fwdays
 
An introduction to Titanium
An introduction to TitaniumAn introduction to Titanium
An introduction to TitaniumGraham Weldon
 
Creating an api from design to security.
Creating an api from design to security.Creating an api from design to security.
Creating an api from design to security.Roan Brasil Monteiro
 
Quick & Dirty Wordpress Customization
Quick & Dirty Wordpress CustomizationQuick & Dirty Wordpress Customization
Quick & Dirty Wordpress CustomizationMagnetic Ideas, LLC
 
Building Big on the Web
Building Big on the WebBuilding Big on the Web
Building Big on the WebCal Henderson
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperlnohuhu
 
.Net Core - not your daddy's dotnet
.Net Core - not your daddy's dotnet.Net Core - not your daddy's dotnet
.Net Core - not your daddy's dotnetRick van den Bosch
 
From HTML5 to Hardware - Simonyi Conference Budapest April 15
From HTML5 to Hardware - Simonyi Conference Budapest April 15From HTML5 to Hardware - Simonyi Conference Budapest April 15
From HTML5 to Hardware - Simonyi Conference Budapest April 15Jan Jongboom
 
Jumping in Jakarta Open Source Project Everything nobody tells you
Jumping in Jakarta Open Source Project  Everything nobody tells youJumping in Jakarta Open Source Project  Everything nobody tells you
Jumping in Jakarta Open Source Project Everything nobody tells youRoan Brasil Monteiro
 
Paving the way with Jakarta EE and apache TomEE at cloudconferenceday
Paving the way with Jakarta EE and apache TomEE at cloudconferencedayPaving the way with Jakarta EE and apache TomEE at cloudconferenceday
Paving the way with Jakarta EE and apache TomEE at cloudconferencedayCésar Hernández
 

What's hot (20)

Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with Jenkins
 
API All the Things!
API All the Things!API All the Things!
API All the Things!
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Internet Explorer 9
Internet Explorer 9Internet Explorer 9
Internet Explorer 9
 
Integração Contínua com PHPCI
Integração Contínua com PHPCIIntegração Contínua com PHPCI
Integração Contínua com PHPCI
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
 
An introduction to Titanium
An introduction to TitaniumAn introduction to Titanium
An introduction to Titanium
 
XMLPasteの紹介
XMLPasteの紹介XMLPasteの紹介
XMLPasteの紹介
 
Creating an api from design to security.
Creating an api from design to security.Creating an api from design to security.
Creating an api from design to security.
 
Quick & Dirty Wordpress Customization
Quick & Dirty Wordpress CustomizationQuick & Dirty Wordpress Customization
Quick & Dirty Wordpress Customization
 
Php test fest
Php test festPhp test fest
Php test fest
 
Building Big on the Web
Building Big on the WebBuilding Big on the Web
Building Big on the Web
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
 
.Net Core - not your daddy's dotnet
.Net Core - not your daddy's dotnet.Net Core - not your daddy's dotnet
.Net Core - not your daddy's dotnet
 
From HTML5 to Hardware - Simonyi Conference Budapest April 15
From HTML5 to Hardware - Simonyi Conference Budapest April 15From HTML5 to Hardware - Simonyi Conference Budapest April 15
From HTML5 to Hardware - Simonyi Conference Budapest April 15
 
Jumping in Jakarta Open Source Project Everything nobody tells you
Jumping in Jakarta Open Source Project  Everything nobody tells youJumping in Jakarta Open Source Project  Everything nobody tells you
Jumping in Jakarta Open Source Project Everything nobody tells you
 
Paving the way with Jakarta EE and apache TomEE at cloudconferenceday
Paving the way with Jakarta EE and apache TomEE at cloudconferencedayPaving the way with Jakarta EE and apache TomEE at cloudconferenceday
Paving the way with Jakarta EE and apache TomEE at cloudconferenceday
 
Make the most of twig
Make the most of twigMake the most of twig
Make the most of twig
 

Similar to Desktop Apps with PHP and Titanium

Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHPEric Johnson
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with PhingMichiel Rook
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architectureElizabeth Smith
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIvo Jansch
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat OverviewMandi Walls
 
Building a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanelBuilding a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanelDominic Lüchinger
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1ADARSH BHATT
 
Chapter 1
Chapter 1Chapter 1
Chapter 1Uma Sam
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
 
PHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionPHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionOto Brglez
 

Similar to Desktop Apps with PHP and Titanium (20)

Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Php
PhpPhp
Php
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
Php
PhpPhp
Php
 
Top 10 python ide
Top 10 python ideTop 10 python ide
Top 10 python ide
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
 
Php unit i
Php unit i Php unit i
Php unit i
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web Services
 
Apache deep learning 101
Apache deep learning 101Apache deep learning 101
Apache deep learning 101
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat Overview
 
Building a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanelBuilding a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanel
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
PHP ITCS 323
PHP ITCS 323PHP ITCS 323
PHP ITCS 323
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
 
PHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor IntroductionPHP: Hypertext Preprocessor Introduction
PHP: Hypertext Preprocessor Introduction
 

More from Ben Ramsey

Api Versioning
Api VersioningApi Versioning
Api VersioningBen Ramsey
 
Grokking REST (ZendCon 2010)
Grokking REST (ZendCon 2010)Grokking REST (ZendCon 2010)
Grokking REST (ZendCon 2010)Ben Ramsey
 
Introduction to AtomPub Web Services
Introduction to AtomPub Web ServicesIntroduction to AtomPub Web Services
Introduction to AtomPub Web ServicesBen Ramsey
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APCBen Ramsey
 
Give Your Site a Boost with Memcache
Give Your Site a Boost with MemcacheGive Your Site a Boost with Memcache
Give Your Site a Boost with MemcacheBen Ramsey
 
Hidden Gems in HTTP
Hidden Gems in HTTPHidden Gems in HTTP
Hidden Gems in HTTPBen Ramsey
 
Grokking the REST Architectural Style
Grokking the REST Architectural StyleGrokking the REST Architectural Style
Grokking the REST Architectural StyleBen Ramsey
 
Making the Most of HTTP In Your Apps
Making the Most of HTTP In Your AppsMaking the Most of HTTP In Your Apps
Making the Most of HTTP In Your AppsBen Ramsey
 
You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!Ben Ramsey
 
Distribution and Publication With Atom Web Services
Distribution and Publication With Atom Web ServicesDistribution and Publication With Atom Web Services
Distribution and Publication With Atom Web ServicesBen Ramsey
 
Distribution and Publication With Atom Web Services
Distribution and Publication With Atom Web ServicesDistribution and Publication With Atom Web Services
Distribution and Publication With Atom Web ServicesBen Ramsey
 

More from Ben Ramsey (11)

Api Versioning
Api VersioningApi Versioning
Api Versioning
 
Grokking REST (ZendCon 2010)
Grokking REST (ZendCon 2010)Grokking REST (ZendCon 2010)
Grokking REST (ZendCon 2010)
 
Introduction to AtomPub Web Services
Introduction to AtomPub Web ServicesIntroduction to AtomPub Web Services
Introduction to AtomPub Web Services
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
Give Your Site a Boost with Memcache
Give Your Site a Boost with MemcacheGive Your Site a Boost with Memcache
Give Your Site a Boost with Memcache
 
Hidden Gems in HTTP
Hidden Gems in HTTPHidden Gems in HTTP
Hidden Gems in HTTP
 
Grokking the REST Architectural Style
Grokking the REST Architectural StyleGrokking the REST Architectural Style
Grokking the REST Architectural Style
 
Making the Most of HTTP In Your Apps
Making the Most of HTTP In Your AppsMaking the Most of HTTP In Your Apps
Making the Most of HTTP In Your Apps
 
You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!You Look Like You Could Use Some REST!
You Look Like You Could Use Some REST!
 
Distribution and Publication With Atom Web Services
Distribution and Publication With Atom Web ServicesDistribution and Publication With Atom Web Services
Distribution and Publication With Atom Web Services
 
Distribution and Publication With Atom Web Services
Distribution and Publication With Atom Web ServicesDistribution and Publication With Atom Web Services
Distribution and Publication With Atom Web Services
 

Recently uploaded

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Recently uploaded (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Desktop Apps with PHP and Titanium

  • 1. Desktop Apps with PHP and Titanium Ben Ramsey TEK·X • May 19, 2010
  • 3. DISCLAIMER: I’m not a salesman & I don’t work for Appcelerator.
  • 4. DISCLAIMER: I helped with the initial embedding of PHP in Titanium.
  • 6.
  • 7.
  • 8. Four main parts of Titanium apps • The html/css/javascript code that makes up the core application logic and UI • The APIs that access native device/ desktop functionality, analytics or other modular functionality • The language-OS bridge that compiles web code into native application code • The run-time shell that packages the application for cross-platform distribution
  • 9. Contrasting with AIR... • Titanium is released under an open source license • Titanium provides access to native controls • Titanium applications are packaged for a target system: Windows, OS X, Linux
  • 11.
  • 12. Appcelerator’s role • Developed and own’s Titanium source • Licenses Titanium under Apache license • Support, training, and consulting • Analytics and tracking • Infrastructure for building and packaging releases of your apps in the cloud
  • 14. So, why PHP on Titanium?
  • 15. • Titanium already had modules to support Python and Ruby development • PHP was on their roadmap • PHP is a natural scripting complement to other web technologies • It was cool and fun to do • I can now build desktop apps with PHP without using PHP-GTK (no offense to the maintainers of PHP-GTK)
  • 17.
  • 18.
  • 19.
  • 20. • Fill out your application details • Click “Create Project” • Click the “Test & Package” tab • Click the “Launch App” button
  • 21.
  • 22. Now, you have code!
  • 23. 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*
  • 25.
  • 26. <html> <head> <title>Hello, World!</title> </head> <body> <h1>Hello, World!</h1> </body> </html>
  • 27.
  • 28.
  • 29. 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;
  • 30.
  • 31. Titanium provides APIs... • API • Media • Analytics • Network • App • Notification • Codec • Platform • Database • Process • Desktop • UI • Filesystem • UpdateManager • JSON • Worker
  • 32. Drop in external libraries
  • 33. Accessing these APIs and libraries • JavaScript • Python • Ruby • PHP
  • 35. <script type="text/php"> // PHP code goes here </script>
  • 36. JavaScript <script type="text/javascript"> var heading = document.getElementById("title"); heading.innerHTML = "Hello, World!"; </script>
  • 37. PHP <script type="text/php"> $heading = $document->getElementById("title"); $heading->innerHTML = "Hello, World!"; </script>
  • 39. <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>
  • 40. 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
  • 41. Are some of these bugs? Maybe.
  • 43. Wrapping up... • Titanium allows web developers the ability to create desktop apps • It builds native applications that you can distribute for a particular OS • You can combine PHP with JavaScript (and Python and Ruby) to leverage the best of each language • Still some bugs to iron out, but that’s why they need lots of people using it