<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Centre of the Universe &#187; Titanium</title>
	<atom:link href="http://www.sergemeunier.com/blog/tag/titanium/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sergemeunier.com/blog</link>
	<description>The musings of a mad software developer</description>
	<lastBuildDate>Tue, 01 Jun 2010 20:26:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Titanium 0.7 is now out with some great new features</title>
		<link>http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 06:08:48 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Appcelerator]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=937</guid>
		<description><![CDATA[Titanium 0.7 has just been released, and some of the features do look rather exciting.
By far, the best new feature is PHP support, which adds a whole new dimension to Titanium development. It will also facilitate the porting of existing codebases and frameworks to Titanium apps, potentially increasing the market substantially.
Another great new feature is [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/appcelerator-launces-app-u-for-titanium/' rel='bookmark' title='Permanent Link: Appcelerator launces App U for Titanium'>Appcelerator launces App U for Titanium</a> <small>In some exciting news from Appcelerator, they have launched Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/adobe-air-2-0-coming-early-next-year/' rel='bookmark' title='Permanent Link: Adobe Air 2.0 coming early next year'>Adobe Air 2.0 coming early next year</a> <small>I saw this morning on Inside RIA that Adobe Air...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Titanium 0.7 has just been released, and some of the features do look rather exciting.</p>
<p>By far, the best new feature is PHP support, which adds a whole new dimension to Titanium development. It will also facilitate the porting of existing codebases and frameworks to Titanium apps, potentially increasing the market substantially.</p>
<p>Another great new feature is the introduction of native social APIs. You will be able to connect to Yahoo YQL, Facebook Connect and Twitter all from directly in a Titanium application.</p>
<p>There are a quite a few smaller changes, and while I have yet to confirm it, I have it on good authority that Titanium 0.7 also now supports native drag and drop functionality.</p>
<p>Things are really looking good and Titanium seems to be maturing nicely. </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-0-7-is-now-out-with-some-great-new-features%2F&amp;linkname=Titanium%200.7%20is%20now%20out%20with%20some%20great%20new%20features"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/appcelerator-launces-app-u-for-titanium/' rel='bookmark' title='Permanent Link: Appcelerator launces App U for Titanium'>Appcelerator launces App U for Titanium</a> <small>In some exciting news from Appcelerator, they have launched Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/adobe-air-2-0-coming-early-next-year/' rel='bookmark' title='Permanent Link: Adobe Air 2.0 coming early next year'>Adobe Air 2.0 coming early next year</a> <small>I saw this morning on Inside RIA that Adobe Air...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Appcelerator launces App U for Titanium</title>
		<link>http://www.sergemeunier.com/blog/appcelerator-launces-app-u-for-titanium/</link>
		<comments>http://www.sergemeunier.com/blog/appcelerator-launces-app-u-for-titanium/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 06:49:29 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Appcelerator]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=864</guid>
		<description><![CDATA[In some exciting news from Appcelerator, they have launched Appcelerator University (or App U for short), which allow you to host training sessions for Titanium. 
They provide all the materials you need, as well as extras like t-shirts and pennants. And don&#8217;t worry if you don&#8217;t know what to talk about, they also provide prepared [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/it-is-not-only-it-projects-that-end-up-late-and-overbudget/' rel='bookmark' title='Permanent Link: It is not only IT projects that end up late and overbudget!'>It is not only IT projects that end up late and overbudget!</a> <small>As a programmer, I am no stranger to projects that...</small></li>
<li><a href='http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/' rel='bookmark' title='Permanent Link: Titanium 0.7 is now out with some great new features'>Titanium 0.7 is now out with some great new features</a> <small>Titanium 0.7 has just been released, and some of the...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In some exciting news from Appcelerator, they have launched <a href="http://www.appcelerator.com/community/app-u/">Appcelerator University</a> (or App U for short), which allow you to host training sessions for Titanium. </p>
<p>They provide all the materials you need, as well as extras like t-shirts and pennants. And don&#8217;t worry if you don&#8217;t know what to talk about, they also provide prepared presentations for you to use.</p>
<p>If anyone is interested in hosting or attending an event, or if anyone in the Cape Town area would like me to host such an event, please leave some comments. I would love to hear your views.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fappcelerator-launces-app-u-for-titanium%2F&amp;linkname=Appcelerator%20launces%20App%20U%20for%20Titanium"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/it-is-not-only-it-projects-that-end-up-late-and-overbudget/' rel='bookmark' title='Permanent Link: It is not only IT projects that end up late and overbudget!'>It is not only IT projects that end up late and overbudget!</a> <small>As a programmer, I am no stranger to projects that...</small></li>
<li><a href='http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/' rel='bookmark' title='Permanent Link: Titanium 0.7 is now out with some great new features'>Titanium 0.7 is now out with some great new features</a> <small>Titanium 0.7 has just been released, and some of the...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/appcelerator-launces-app-u-for-titanium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anyone interested in a Titanium Webinar?</title>
		<link>http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/</link>
		<comments>http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 06:37:54 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Appcelerator]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=861</guid>
		<description><![CDATA[I got contacted a few days ago by the Appcelerator Titanium team with some rather exciting news. Appcelerator are interested in hosting a Webinar on Titanium, particularly tailored to you, my readers, interests.
I would like to encourage anyone who is interested to leave a comment with when would suit you to hold it, and any [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/appcelerator-launces-app-u-for-titanium/' rel='bookmark' title='Permanent Link: Appcelerator launces App U for Titanium'>Appcelerator launces App U for Titanium</a> <small>In some exciting news from Appcelerator, they have launched Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/' rel='bookmark' title='Permanent Link: Titanium 0.7 is now out with some great new features'>Titanium 0.7 is now out with some great new features</a> <small>Titanium 0.7 has just been released, and some of the...</small></li>
<li><a href='http://www.sergemeunier.com/blog/cmis-1-0-speciification-now-available-for-comment/' rel='bookmark' title='Permanent Link: CMIS 1.0 specification now available for comment'>CMIS 1.0 specification now available for comment</a> <small>CMIS 1.0 was released for public comment recently, and is...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I got contacted a few days ago by the Appcelerator Titanium team with some rather exciting news. Appcelerator are interested in hosting a Webinar on Titanium, particularly tailored to you, my readers, interests.</p>
<p>I would like to encourage anyone who is interested to leave a comment with when would suit you to hold it, and any topics which you would like to discus. I will then let Appcelerator know, and then we can organise it. </p>
<p>Hope to hear from all of you&#8230;.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fanyone-interested-in-a-titanium-webinar%2F&amp;linkname=Anyone%20interested%20in%20a%20Titanium%20Webinar%3F"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/appcelerator-launces-app-u-for-titanium/' rel='bookmark' title='Permanent Link: Appcelerator launces App U for Titanium'>Appcelerator launces App U for Titanium</a> <small>In some exciting news from Appcelerator, they have launched Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/' rel='bookmark' title='Permanent Link: Titanium 0.7 is now out with some great new features'>Titanium 0.7 is now out with some great new features</a> <small>Titanium 0.7 has just been released, and some of the...</small></li>
<li><a href='http://www.sergemeunier.com/blog/cmis-1-0-speciification-now-available-for-comment/' rel='bookmark' title='Permanent Link: CMIS 1.0 specification now available for comment'>CMIS 1.0 specification now available for comment</a> <small>CMIS 1.0 was released for public comment recently, and is...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Titanium Tutorials: Embedding Flash objects in a Titanium window</title>
		<link>http://www.sergemeunier.com/blog/titanium-tutorials-embedding-flash-objects-in-a-titanium-window/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-tutorials-embedding-flash-objects-in-a-titanium-window/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 11:01:51 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=159</guid>
		<description><![CDATA[I was very pleasantly surprised to find that Appcelerator Titanium has the ability to embed Flash objects into a Titanium window.
For a normal web browser, before the browser can display a Flash object, the Flash player needs to be installed as a plugin on the computer first. Titanium, however, has got the Flash player included [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/cufon-brings-any-font-to-a-browser-near-you/' rel='bookmark' title='Permanent Link: Cufon brings any font to a browser near you'>Cufon brings any font to a browser near you</a> <small>I stumbled upon a rather useful Javascript library the other...</small></li>
<li><a href='http://www.sergemeunier.com/blog/adobe-air-2-0-and-flash-player-10-1-betas-have-been-launched/' rel='bookmark' title='Permanent Link: Adobe Air 2.0 and Flash Player 10.1 betas have been launched'>Adobe Air 2.0 and Flash Player 10.1 betas have been launched</a> <small>Ah, the sheer programming bliss. I have been eagerly awaiting...</small></li>
<li><a href='http://www.sergemeunier.com/blog/creating-a-basic-map-using-the-google-maps-api/' rel='bookmark' title='Permanent Link: Creating a basic map using the Google Maps API'>Creating a basic map using the Google Maps API</a> <small>The first thing you need to be able to use...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I was very pleasantly surprised to find that Appcelerator Titanium has the ability to embed Flash objects into a Titanium window.</p>
<p>For a normal web browser, before the browser can display a Flash object, the Flash player needs to be installed as a plugin on the computer first. Titanium, however, has got the Flash player included already, which means that when working with Flash, you never need worry about showing a message asking the user to install the plugin before they can view the site. It just always works.</p>
<p>There are two ways in which a Flash object can be embedded into a page. It can either be done with an <strong>&lt;object&gt;</strong> tag, or using the Javascript <strong>swfobject</strong> object.<br />
<span id="more-159"></span></p>
<p>Using the HTML tag:</p>
<pre name="code" class="html">   &lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
         width="780" height="420"&gt;
      &lt;param name="src" value="media/sample.swf" /&gt;
      &lt;object type="application/x-shockwave-flash" data="media/sample.swf"
            width="780" height="420"&gt;
       &lt;/object&gt;
   &lt;/object&gt;</pre>
<p>In the above example, the <strong>classid</strong> of the object must always be set to the value in the sample code. The <strong>movie</strong> parameter is also the only required parameter, and points to URL of the Flash object you want to display</p>
<p>Here is some sample code of including a Flash object using Javascript:</p>
<pre name="code" class="javascript">&lt;script type="text/javascript" src="js/swfobject.js"&gt;&lt;/script&gt;

   &lt;p id="sampleFlash"&gt;Flash will go here&lt;/p&gt;
   &lt;script type="text/javascript"&gt;
      var flashvars = {
         var1: 'Hello World',
         anotherVar: '7'
      };

      swfobject.embedSWF(
         'media/sample.swf', // path to the widget
         'sampleFlash', //id of HTML element to replace
         '200', // width of the widget
         '200', // height of the widget
         '8', //Flash version
         null, //express install path - not needed since Flash installed
         flashvars, //Variables to pass to Flash object
         {scale: 'noscale', wmode: 'transparent'} //parameters to pass
      );
   &lt;/script&gt;</pre>
<p>The first thing to notice here is the the swfobject.js file, which can be obtained from the <a href="http://code.google.com/p/swfobject/">swfobject project site</a>, needs to be included on the page, as this contains the necessary Javascript for the <strong>swfobject</strong> object.</p>
<p>Then you need to add an HTML element on the page which will be replaced by the Flash object.</p>
<p>Finally, we need to add the Javascript code to add the object to the page. We embed the Flash object with the <strong>swfobject.embedSWF()</strong> function.</p>
<p>Titanium also allows the Flash object to be either a local file or a remote file, thus using Flash in Titanium is pretty much limitless.</p>
<p>Visit the <a href="http://code.google.com/p/swfobject/">swfobject project site</a> for more information on using the <strong>swfobject</strong> object.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-tutorials-embedding-flash-objects-in-a-titanium-window%2F&amp;linkname=Titanium%20Tutorials%3A%20Embedding%20Flash%20objects%20in%20a%20Titanium%20window"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/cufon-brings-any-font-to-a-browser-near-you/' rel='bookmark' title='Permanent Link: Cufon brings any font to a browser near you'>Cufon brings any font to a browser near you</a> <small>I stumbled upon a rather useful Javascript library the other...</small></li>
<li><a href='http://www.sergemeunier.com/blog/adobe-air-2-0-and-flash-player-10-1-betas-have-been-launched/' rel='bookmark' title='Permanent Link: Adobe Air 2.0 and Flash Player 10.1 betas have been launched'>Adobe Air 2.0 and Flash Player 10.1 betas have been launched</a> <small>Ah, the sheer programming bliss. I have been eagerly awaiting...</small></li>
<li><a href='http://www.sergemeunier.com/blog/creating-a-basic-map-using-the-google-maps-api/' rel='bookmark' title='Permanent Link: Creating a basic map using the Google Maps API'>Creating a basic map using the Google Maps API</a> <small>The first thing you need to be able to use...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-tutorials-embedding-flash-objects-in-a-titanium-window/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Titanium Tutorial: Calling the Titanium API from a remote file</title>
		<link>http://www.sergemeunier.com/blog/titanium-tutorial-calling-the-titanium-api-from-a-remote-file/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-tutorial-calling-the-titanium-api-from-a-remote-file/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 11:23:33 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=146</guid>
		<description><![CDATA[Appcelerator Titanium is pretty free with what it allows you to do, imposing very few restrictions to access. One thing that I did find it did not like you doing is accessing the Titanium API from a remote HTML file.
A Titanium app can load a file into a window using either the HTTP or the [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/how-browser-incompatibility-can-waste-my-day/' rel='bookmark' title='Permanent Link: How browser incompatibility can waste my day'>How browser incompatibility can waste my day</a> <small>I got struck by a curious problem the other day....</small></li>
<li><a href='http://www.sergemeunier.com/blog/a-possible-replacement-for-http-in-the-works/' rel='bookmark' title='Permanent Link: A possible replacement for HTTP in the works'>A possible replacement for HTTP in the works</a> <small>If the good old rumour mill of the internet is...</small></li>
<li><a href='http://www.sergemeunier.com/blog/transferring-files-using-sftp-in-c-sharp/' rel='bookmark' title='Permanent Link: Transferring files using SFTP in C#'>Transferring files using SFTP in C#</a> <small>C# does not have native capabilities to use SFTP, but...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Appcelerator Titanium is pretty free with what it allows you to do, imposing very few restrictions to access. One thing that I did find it did not like you doing is accessing the Titanium API from a remote HTML file.</p>
<p>A Titanium app can load a file into a window using either the <strong>HTTP</strong> or the <strong>APP</strong> protocol. The <strong>APP</strong> protocol is a Titanium specific protocol which tells Titanium to reference the local resource folder for the page to display.</p>
<p>The crucial difference here is that a page loaded using <strong>APP</strong> is allowed to access the Titanium API and make calls to it freely. Pages loaded via <strong>HTTP</strong> cannot.</p>
<p>This means that if you have an HTML page sitting on a webserver somewhere, and it contains a call to the Titanium API, it will not work if you load that page into a Titanium window. The page will work normally if there are no Titanium calls.</p>
<p>So, what do you do when you want to have code sitting on a remote server that you want to be able to run in Titanium?</p>
<p>There is a very easy way in which to accomplish this.<br />
<span id="more-146"></span></p>
<p>The first step is to put any Javascript you want to run on the remote server into a JS file rather than directly in the HTML page.</p>
<p>Now, there is no way to get around having a local HTML page, so you would need to create a local HTML page, and then you can reference the remote JS file. For example:</p>
<pre name="code" class="javascript">&lt;html&gt;
   &lt;head&gt;
      &lt;script src="http://www.someserver.com/test.js" language="Javascript"&gt;
      &lt;/script&gt;
   &lt;/head&gt;
&lt;/html&gt;</pre>
<p>The page will then load the Javascript, running it as if the page was loaded locally, while having (almost) all the code on the server.</p>
<p>This works very well for an application where the HTML page is used mainly as a frame for the Javascript which renders all the page elements.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-tutorial-calling-the-titanium-api-from-a-remote-file%2F&amp;linkname=Titanium%20Tutorial%3A%20Calling%20the%20Titanium%20API%20from%20a%20remote%20file"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/how-browser-incompatibility-can-waste-my-day/' rel='bookmark' title='Permanent Link: How browser incompatibility can waste my day'>How browser incompatibility can waste my day</a> <small>I got struck by a curious problem the other day....</small></li>
<li><a href='http://www.sergemeunier.com/blog/a-possible-replacement-for-http-in-the-works/' rel='bookmark' title='Permanent Link: A possible replacement for HTTP in the works'>A possible replacement for HTTP in the works</a> <small>If the good old rumour mill of the internet is...</small></li>
<li><a href='http://www.sergemeunier.com/blog/transferring-files-using-sftp-in-c-sharp/' rel='bookmark' title='Permanent Link: Transferring files using SFTP in C#'>Transferring files using SFTP in C#</a> <small>C# does not have native capabilities to use SFTP, but...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-tutorial-calling-the-titanium-api-from-a-remote-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Titanium Tutorial: Browsing folder contents programmatically</title>
		<link>http://www.sergemeunier.com/blog/titanium-tutorial-browsing-folder-contents-programmatically/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-tutorial-browsing-folder-contents-programmatically/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 09:11:09 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=113</guid>
		<description><![CDATA[A very useful feature of desktop applications is being able to browse the contents of a folder programmatically, which makes all manner of explorer type applications possible. Appcelerator Titanium makes this very easy to do.
Thanks to to mrobinson on the Titanium for pointing out the needed function in the API. I wasted several hours looking [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/obtaining-the-contents-of-a-folder-in-c-sharp/' rel='bookmark' title='Permanent Link: Obtaining the contents of a folder in C#'>Obtaining the contents of a folder in C#</a> <small>Getting the list of files in a folder in C3...</small></li>
<li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/' rel='bookmark' title='Permanent Link: Titanium 0.7 is now out with some great new features'>Titanium 0.7 is now out with some great new features</a> <small>Titanium 0.7 has just been released, and some of the...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A very useful feature of desktop applications is being able to browse the contents of a folder programmatically, which makes all manner of explorer type applications possible. Appcelerator Titanium makes this very easy to do.</p>
<p>Thanks to to mrobinson on the Titanium for pointing out the needed function in the API. I wasted several hours looking in the wrong place for how to do this.</p>
<p>The functionality to get the directory listing is found in the <strong>File </strong>object.</p>
<p>The example listed in the Titanium API is as follows:</p>
<pre name="code" class="javascript">   var win = Titanium.UI.getCurrentWindow();

   win.openFolderChooserDialog(function(folderResponse) {
      var file = Titanium.Filesystem.getFile(folderResponse[0]);
      var listing = file.getDirectoryListing();
      for (var i = 0; i &lt; listing.length; i++) {
         alert('Name: ' + listing[i].name() +
            ',isDirectory: ' + listing[i].isDirectory() +
            ',isHidden: ' + listing[i].isHidden());
      }
   });</pre>
<p><span id="more-113"></span></p>
<p>First we show a Folder Chooser dialog, which works very similarly to the File Chooser dialog which I covered in a previous <a href="http://www.sergemeunier.com/blog/titanium-tutorial-using-the-file-selection-dialog-boxes/">blog post</a>. The file chooser calls a callback function and asses an array as the parameter. If a folder is selected, it will be contained in the first element in the array.</p>
<p>Next, we get a reference to the file <strong><span>Titanium.Filesystem.getFile()</span></strong>with the folder path as the parameter.</p>
<p>The crucial step then, is to call <strong>file.getDirectoryListing()</strong> which gets an array of file objects representing the files and folders in the selected folder.</p>
<p>You can then loop through this array and process the results in whichever way your application needs.</p>
<p>Some useful functions are <strong>listing[i].name() </strong>which lists the name of the file or folder without the full path, <strong>listing[i].isDirectory()</strong> which returns whether it is a folder or file, and <strong>listing[i].nativePath()</strong> which returns the full path of the file.</p>
<p>You can view the <a href="http://www.codestrong.com/titanium/api/titanium/Filesystem/File/getDirectoryListing/">Titanium API Documentation</a> for more details.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-tutorial-browsing-folder-contents-programmatically%2F&amp;linkname=Titanium%20Tutorial%3A%20Browsing%20folder%20contents%20programmatically"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/obtaining-the-contents-of-a-folder-in-c-sharp/' rel='bookmark' title='Permanent Link: Obtaining the contents of a folder in C#'>Obtaining the contents of a folder in C#</a> <small>Getting the list of files in a folder in C3...</small></li>
<li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
<li><a href='http://www.sergemeunier.com/blog/titanium-0-7-is-now-out-with-some-great-new-features/' rel='bookmark' title='Permanent Link: Titanium 0.7 is now out with some great new features'>Titanium 0.7 is now out with some great new features</a> <small>Titanium 0.7 has just been released, and some of the...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-tutorial-browsing-folder-contents-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Titanium Tutorial: Using the file selection dialog boxes</title>
		<link>http://www.sergemeunier.com/blog/titanium-tutorial-using-the-file-selection-dialog-boxes/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-tutorial-using-the-file-selection-dialog-boxes/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 14:10:03 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=84</guid>
		<description><![CDATA[Appcelerator Titanium enables you to show a dialog box to select files which you would like to save or open.
To open a SaveAs dialog box, we first set up the options object, and then call the function to open the dialog, passing it the callback function to call once it is closed.
  var options [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Appcelerator Titanium enables you to show a dialog box to select files which you would like to save or open.</p>
<p>To open a SaveAs dialog box, we first set up the options object, and then call the function to open the dialog, passing it the callback function to call once it is closed.</p>
<pre name="code" class="javascript">  var options = {
     title: "Save file as...",
     types: ['*'],
     typesDescription: "All files",
     path: Titanium.Filesystem.getUserDirectory()
  }

  Titanium.UI.openSaveAsDialog(callbackFunc, options);</pre>
<p>In <strong>types </strong>we put the file types  filter, for example ['doc', 'txt]. The <strong>path </strong>is the default path to point the dialog to.</p>
<p>Next in the callback function, we can reference the filename which is returned as an array, which when saving a file is always going to be one element, but may be multiple filenames for an Open dialog.</p>
<pre name="code" class="javascript">   callbackFunc = function(filenames){
      var fileSelected = filenames[0];
   }</pre>
<p><span id="more-84"></span></p>
<p>Creating a file chooser dialog is very similar. This dialog allows multiple files to be selected.</p>
<pre name="code" class="javascript">   var options = {
      multiple: true,
      title: "Select files to open...",
      types: ['doc', 'txt'],
      typesDescription: "Documents",
      path: Titanium.Filesystem.getUserDirectory()
   }
   Titanium.UI.openFileChooserDialog(callbackFunc, options);</pre>
<p>In the callback function, the only difference is that the array of filenames may have more than 1 filenames in it.</p>
<pre name="code" class="javascript">   callbackFunc = function(filenames) {
      var firstFileSelected = filenames[0];
      var secondFileSelected = filenames[1];
   }</pre>
<p>That is all there is to showing and processing file dialogs.</p>
<p>I would point you to the Titanium API documention at this point, but have found no reference to the dialogs in the 0.4 documentation.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-tutorial-using-the-file-selection-dialog-boxes%2F&amp;linkname=Titanium%20Tutorial%3A%20Using%20the%20file%20selection%20dialog%20boxes"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-tutorial-using-the-file-selection-dialog-boxes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Titanium Tutorial: Window management</title>
		<link>http://www.sergemeunier.com/blog/titanium-tutorial-window-management/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-tutorial-window-management/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 07:22:15 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=77</guid>
		<description><![CDATA[Appcelerator Titanium has a rich set of Window management methods which are accessible with the UserWindow object and the Titanium.UI namespace.
The basics of opening up a new window in Titanium is as follows:
   var currentWindow = Titanium.UI.getCurrentWindow();
   var newWindow = currentWindow.createWindow('http://www.google.com');
   newWindow.setWidth(400);
   newWindow.setHeight(300);
   newWindow.open();
First, we [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Appcelerator Titanium has a rich set of Window management methods which are accessible with the <strong>UserWindow</strong> object and the <strong>Titanium.UI</strong> namespace.</p>
<p>The basics of opening up a new window in Titanium is as follows:</p>
<pre name="code" class="javascript">   var currentWindow = Titanium.UI.getCurrentWindow();
   var newWindow = currentWindow.createWindow('http://www.google.com');
   newWindow.setWidth(400);
   newWindow.setHeight(300);
   newWindow.open();</pre>
<p>First, we need to get the current window we want to work with, from which we are going to open the new window. This window will become the new window&#8217;s parent.</p>
<p>The new window is created with the <strong>.createWindow() </strong>method. The parameter is an optional parameter, but can be either a url, or an object containing the parameters for the new window. The url can be either an external url, which is signified by using <strong>http://</strong> in the url, or else it can be a url pointing to an internal location in the application, which is prefixed by <strong>app://</strong> and then the path to the html page to display.<br />
<span id="more-77"></span></p>
<p>Next we set a few attributes of the window. There is large amount of attributes that can be changed, which can be found in the documentation.</p>
<p>The last step now is to actually open the window, which is done with <strong>newWindow.open()</strong>.</p>
<p>Closing a window is very easy, and all it entails is calling <strong>newWindow.close()</strong>.</p>
<p>Useful properties of <strong>Titanium.UI</strong> are <strong>Titanium.UI.mainWindow </strong>which is a reference to the main application reference, and<strong>Titanium.UI.windows</strong>, which is a list of all the windows in the application. The first element in the list (element 0) is the main window, and all user windows are then after that, ie. from 1 upwards. As an example, getting the width of the first window created by the application looks as follows:</p>
<pre name="code" class="javascript">   Titanium.UI.windows[1].getWidth();</pre>
<p>The parent window can also be accessed very easily from the child window using the <strong>getParent()</strong> method, which returns a reference to the parent window object. For example, to get the title of the parent window we can write:</p>
<pre name="code" class="javascript">   newWindow.getParent().getTitle();</pre>
<p>The <strong>UserWindow</strong> object makes it easy to work with almost any aspect of a window, and the full listing of available methods can be found at the <a href="http://www.codestrong.com/titanium/api/titanium/UI/UserWindow/">Titanium API Documentation</a>.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-tutorial-window-management%2F&amp;linkname=Titanium%20Tutorial%3A%20Window%20management"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/anyone-interested-in-a-titanium-webinar/' rel='bookmark' title='Permanent Link: Anyone interested in a Titanium Webinar?'>Anyone interested in a Titanium Webinar?</a> <small>I got contacted a few days ago by the Appcelerator...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-tutorial-window-management/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Titanium Tutorial: Accessing files on the local system</title>
		<link>http://www.sergemeunier.com/blog/titanium-tutorial-accessing-files-on-the-local-system/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-tutorial-accessing-files-on-the-local-system/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 06:02:31 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=72</guid>
		<description><![CDATA[Out of all the features included in Appcelerator Titanium which sets it apart from a conventional web application is not things like the SQLite database, which is included in the HTML 5 spec, and so will be in browsers everywhere soon, or the menu system, which can be easily replicated using CSS, but rather, it [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/compression-using-c-sharp/' rel='bookmark' title='Permanent Link: Compression using C#'>Compression using C#</a> <small>You would have thought that .NET, with its vast libraries...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Out of all the features included in Appcelerator Titanium which sets it apart from a conventional web application is not things like the SQLite database, which is included in the HTML 5 spec, and so will be in browsers everywhere soon, or the menu system, which can be easily replicated using CSS, but rather, it is Titanium&#8217;s ability to read and write files to and from the local file system that truly makes the platform a desktop-friendly platform, while keeping the flexibility of a web app.</p>
<p>File access in Titanium is very similar to how it is done in other languages like PHP or C#. The objects used are the <strong>File</strong> and <strong>FileStream</strong> objects, and the <strong>Titanium.Filesystem</strong> namespace.</p>
<p>So, to write some data to a file, the code is as follows:</p>
<pre name="code" class="javascript">   var contents = "Some contents to write";
   var filename = 'test.txt';
   var userDir = Titanium.Filesystem.getUserDirectory();
   var writeFile = Titanium.Filesystem.getFile(userDir, filename);
   var writeStream = Titanium.Filesystem.getFileStream(writeFile);
   writeStream.open(Titanium.Filesystem.MODE_WRITE);
   writeStream.write(contents);
   writeStream.close();</pre>
<p><strong>Titanium.Filesystem.getUserDirectory()</strong> gets the user directory of the currently logged in user. Other useful options here are <strong>getDocumentsDirectory()</strong>,<strong> getApplicationDirectory()</strong> and <strong>getDesktopDirectory(). </strong>The directory can also be a string representing any folder on the user&#8217;s machine but these functions provide a cross-platform method of obtaining the most common directories needed.<br />
<span id="more-72"></span></p>
<p>We then get the full file path as a string, using the directory (in this case the user directory) and the filename, after which we create an instance of the file stream, using the file path as a parameter.</p>
<p>Once we have created the file stream, we need to open the stream. For write access, we set the parameter to <strong>Titanium.Filesystem.MODE_WRITE</strong>.</p>
<p>All we need to do to write data to the file is call <strong>writeStream.write(contents)</strong> where contents is any arbitrary variable. To write data line by line we can use <strong>.writeLine()</strong>.</p>
<p>Once we are done writing, we need to close the stream.</p>
<p>If the file we are trying to write to does not exist, then a new file will be created. If the file already exists then the original file will be overwritten. If you need to preserve the original file you can use <strong>Titanium.Filesystem.MODE_APPEND</strong> as the parameter when opening the stream, which will allow you to add data to the end of an existing file.</p>
<p>To read data from a file is just as easy:</p>
<pre name="code" class="javascript">   var readContents;
   var filename = 'test.txt';
   var userDir = Titanium.Filesystem.getUserDirectory();
   var readFile = Titanium.Filesystem.getFile(userDir, filename);
   if (readFile.exists()){
      var readStream = Titanium.Filesystem.getFileStream(readFile);
      readStream.open(Titanium.Filesystem.MODE_READ);
      readContents = readStream.read();
      readStream.close();
   }</pre>
<p>The main differences to the code for writing compared to reading files, is that before we can open the file stream, we need to make sure the file exists first.</p>
<p>If the file exists we can create the instance of the stream, and then open the stream in read mode.</p>
<p>Once that is open we can call<strong> readStream.read()</strong> to read the contents of the file, which we can then store in a variable. We can also use <strong>.readLine()</strong> if wewant to read the data line by line, instead of as one large chunk.</p>
<p>For more information on the file access objects in Titanium, you can refer to the <a href="http://www.codestrong.com/titanium/api/titanium/Filesystem/">Titanium API Documentation.</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-tutorial-accessing-files-on-the-local-system%2F&amp;linkname=Titanium%20Tutorial%3A%20Accessing%20files%20on%20the%20local%20system"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/compression-using-c-sharp/' rel='bookmark' title='Permanent Link: Compression using C#'>Compression using C#</a> <small>You would have thought that .NET, with its vast libraries...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-tutorial-accessing-files-on-the-local-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Titanium Tutorial: Using the SQLite database synchronously</title>
		<link>http://www.sergemeunier.com/blog/titanium-tutorial-using-the-sqlite-database-synchronously/</link>
		<comments>http://www.sergemeunier.com/blog/titanium-tutorial-using-the-sqlite-database-synchronously/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 20:46:55 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Titanium]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=57</guid>
		<description><![CDATA[Appcelerator Titanium has built in support for using SQLite databases either asynchronously or synchronously. It is a fair bit easier doing it synchronously, and for my application, it had to work that way for it to work correctly, so I will go throught that first, and in a later tutorial explain how to set up [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/using-mysql-from-visual-studio/' rel='bookmark' title='Permanent Link: Using MySQL from Visual Studio.NET'>Using MySQL from Visual Studio.NET</a> <small>Visual Studio.NET is very geared to being paired up with...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Appcelerator Titanium has built in support for using SQLite databases either asynchronously or synchronously. It is a fair bit easier doing it synchronously, and for my application, it had to work that way for it to work correctly, so I will go throught that first, and in a later tutorial explain how to set up an asynchronous database.</p>
<p>Using the SQLite database is a simple affair, and makes use of the<strong>Titanium.Database </strong>namespace and the <strong>DB </strong>and <strong>ResultSet </strong>objects.</p>
<p>So, the first step is to connect to a database:</p>
<pre name="code" class="javascript">   var db = Titanium.Database.open('session_db');</pre>
<p>The parameter is the name of the database to open.<br />
<span id="more-57"></span></p>
<p>Next, we execute a sql command on the database:</p>
<pre name="code" class="javascript">   var rs = db.execute('SELECT [value] FROM [session]
        WHERE [key] = \'' + val + '\'');
   if(rs.isValidRow()){
      val = rs.field(0);
   }
   rs.close();</pre>
<p>The result set from the database call is returned, and then we can extract the data out of the resultset. If a command does not return a result set, such as a DELETE or an INSERT command, then the <strong>.execute()</strong> method can be called without assigning the result to anything. Once the result set has been used, it can be closed.</p>
<p>Once we are done with the database, we can then close it:</p>
<pre name="code" class="javascript">   db.close();</pre>
<p>More information on the <strong>DB </strong>object can be found in the <a href="http://www.codestrong.com/titanium/api/titanium/Database/">Titanium API Documentation</a>.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Ftitanium-tutorial-using-the-sqlite-database-synchronously%2F&amp;linkname=Titanium%20Tutorial%3A%20Using%20the%20SQLite%20database%20synchronously"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/using-mysql-from-visual-studio/' rel='bookmark' title='Permanent Link: Using MySQL from Visual Studio.NET'>Using MySQL from Visual Studio.NET</a> <small>Visual Studio.NET is very geared to being paired up with...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/titanium-tutorial-using-the-sqlite-database-synchronously/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
