<?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>MDPauley.Com</title>
	<atom:link href="http://mdpauley.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mdpauley.com</link>
	<description>apps and ideas by me</description>
	<lastBuildDate>Tue, 21 Feb 2012 18:47:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Join Nolan Wright and Zeon for a Cross-Platform Dev Webinar</title>
		<link>http://developer.appcelerator.com/blog/2012/02/join-nolan-wright-and-zeon-for-a-cross-platform-dev-webinar.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=join-nolan-wright-and-zeon-for-a-cross-platform-dev-webinar</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/join-nolan-wright-and-zeon-for-a-cross-platform-dev-webinar.html#comments</comments>
		<pubDate>Tue, 21 Feb 2012 18:47:26 +0000</pubDate>
		<dc:creator>Kevin Whinnery</dc:creator>
				<category><![CDATA[@en]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18489</guid>
		<description><![CDATA[Appcelerator CTO Nolan Wright will be co-hosting a webinar with Zeon, covering the business case for developing apps with Titanium. Via Zeon: Many organizations are building mobile applications to extend the functionality of their current systems to their partners and customers. Mobile applications are becoming an essential tool for business. During this webinar, you will [...]]]></description>
			<content:encoded><![CDATA[<p>Appcelerator CTO Nolan Wright will be co-hosting <a href="http://www.zeonsolutions.com/company/webinars/cross-platform-mobile-applications" >a webinar with Zeon</a>, covering the business case for developing apps with Titanium.  Via Zeon:</p>
<div style="margin-top:-10px;padding:20px;font-size:12px;font-style:italic;background-color:#cdcdcd;border-color:#000;border-width:1px;">
Many organizations are building mobile applications to extend the functionality of their current systems to their partners and customers. Mobile applications are becoming an essential tool for business. During this webinar, you will learn how to provide enhanced customer self-service and deliver productivity tools throughout the industry you serve.<br />
In this informational webinar, you will learn:</p>
<ul>
<li>Reasons for using Appcelerator for your Mobile Application projects</li>
<li>Accurately addressing and overcoming your top business challenges</li>
<li>Creating Apps that deliver for your business, within your budget</li>
</ul>
<p style="margin-top:10px">
<a href="http://www.zeonsolutions.com/company/webinars/cross-platform-mobile-applications" >Join us for this informational webinar</a> on how Zeon Solutions and Appcelerator Titanium can help you develop mobile applications that fit all of your business needs.
</p>
</div>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/join-nolan-wright-and-zeon-for-a-cross-platform-dev-webinar.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Newbie Tuesday: Hybrid App Basics Part 1</title>
		<link>http://developer.appcelerator.com/blog/2012/02/newbie-tuesday-hybrid-app-basics-part-1.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=newbie-tuesday-hybrid-app-basics-part-1</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/newbie-tuesday-hybrid-app-basics-part-1.html#comments</comments>
		<pubDate>Tue, 21 Feb 2012 13:21:41 +0000</pubDate>
		<dc:creator>Kevin Whinnery</dc:creator>
				<category><![CDATA[@en]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18515</guid>
		<description><![CDATA[The following is the latest entry in a series of Tuesday blog posts covering basic topics in Titanium and JavaScript development. Titanium allows developers to use local HTML inside a WebView component. There are a variety of compelling use cases for this, in situations where the browser provides the best tools for a given job. [...]]]></description>
			<content:encoded><![CDATA[<style>
pre {background-color:#ffffff;border-radius:5px;padding:10px;}
</style>
<p><strong>The following is the latest entry in a series of Tuesday blog posts covering basic topics in Titanium and JavaScript development.</strong></p>
<p>Titanium allows developers to use local HTML inside a <a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.WebView-object" >WebView component</a>.  There are a variety of compelling use cases for this, in situations where the browser provides the best tools for a given job.  Whether it&#8217;s <a href="http://mrdoob.github.com/three.js/examples/canvas_camera_orthographic.html" >badass canvas libraries like three.js</a>, as seen in the <a href="http://developer.appcelerator.com/blog/2011/12/forging-titanium-episode-16-twisti-part-3-sockets.html" >&#8220;Twisti&#8221; series on Forging Titanium</a>, or simply displaying structured text in HTML, there are lots of places where a WebView and local HTML content may be the best solution.</p>
<p>Beyond these targeted uses of HTML in native applications, some apps choose to use HTML and CSS to render their entire user interface.  These types of apps are popularly referred to as &#8220;hybrid&#8221; applications, where an HTML page is wrapped in a native shell, giving it access to native functions not usually available to a web application.  <em><strong>Now, generally we believe that native UI is best for native applications, and will produce the most performant, familiar, and responsive interface.</strong></em>  However, there may be use cases where an HTML/CSS-based UI may make sense given your app&#8217;s requirements.</p>
<p><a href="http://jquerymobile.com/"/><img style="float:left;margin:0 10px 10px 0" src="http://img.skitch.com/20120221-qfpbr427gb5mmj62cicq6ttte7.png"/></a>In these situations, Titanium presents a very flexible hybrid application solution, while still retaining access to the thousands of native APIs and full native extensibility provided by the Titanium Mobile SDK.  In this tutorial, we will show how local web pages can access native APIs in Titanium, using <a href="http://jquerymobile.com/" >jQuery Mobile</a> for our hybrid app&#8217;s user interface.</p>
<h3>Embedding Local HTML</h3>
<p>Creating an embedded WebView which references local HTML is trivial in the Titanium JavaScript API:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> win <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createWindow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> webView <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createWebView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	url<span style="color: #339933;">:</span><span style="color: #3366CC;">'/index.html'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
win.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>webView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
win.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now, we place our index.html file, and <a href="http://jquerymobile.com/download/" >the dependencies from jQuery Mobile</a>, in our resources directory:</p>
<p><img src="http://img.skitch.com/20120221-mqcnuhaw9ebqu2g8xngr1u2auj.png"/></p>
<p><a href="https://github.com/appcelerator-developer-relations/HybridApp/blob/a1b8c5418cf54fcfc90f594f79b419d3efc776ed/Resources/index.html" >After throwing together some HTML to showcase basic jQuery Mobile UI</a>, we&#8217;ll end up with a user interface which looks something like this:</p>
<p><a href="https://skitch.com/kwhinnery/8duaj/ios-simulator"><img style="max-width:638px" src="https://img.skitch.com/20120221-dhpb59npk8nttsw7wkx9n5w1d1.medium.jpg" alt="iOS Simulator" /></a></p>
<p><em>Important note:</em> By default, Titanium processes all JavaScript in the resources directory on Android to optimize for native apps.  For a hybrid app today, you must prevent this behavior to keep your application HTML&#8217;s directory paths intact.  To accomplish this, add the following line to your tiapp.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ti.android.compilejs&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;bool&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>So that&#8217;s the first part of the puzzle &#8211; in this way, we can embed and use local HTML in out native app just like we would if we were programming in the browser.  But how do we access native functionality?  Titanium doesn&#8217;t actually expose native APIs directly to the WebView.  Native APIs are accessed indirectly using Ti.App.fireEvent and Ti.App.addEventListener.  Using these messaging APIs, we can communicate between the JavaScript context of the web view wrapper and the native app.</p>
<p>We&#8217;ll explore techniques for doing that in the next article in this series. </p>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/newbie-tuesday-hybrid-app-basics-part-1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submit your app: “Built With Titanium”</title>
		<link>http://developer.appcelerator.com/blog/2012/02/submit-your-app-built-with-titanium.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=submit-your-app-built-with-titanium</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/submit-your-app-built-with-titanium.html#comments</comments>
		<pubDate>Mon, 20 Feb 2012 15:30:09 +0000</pubDate>
		<dc:creator>Kevin Whinnery</dc:creator>
				<category><![CDATA[@en]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18450</guid>
		<description><![CDATA[A new community site has sprung up dedicated to showcasing the 30,000+ apps built with Titanium! Sharry Stowell (of Learning Titanium) has posted this new community site where developers can add their applications to a categorized showcase. To submit your application, tweet a link to your app in the store/market where it resides to TiBuilt. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.builtwithtitanium.com/"><img src="http://www.builtwithtitanium.com/wp-content/uploads/2012/02/bit_logo_154x150.gif" style="float:left;margin-right:10px;margin-bottom:10px;"/></a> <a href="http://www.builtwithtitanium.com/" >A new community site</a> has sprung up dedicated to showcasing the 30,000+ apps built with Titanium!  Sharry Stowell (of <a href="http://www.learningtitanium.com/" >Learning Titanium</a>) has posted this new community site where developers can add their applications to a categorized showcase.</p>
<p>To submit your application, <a href="https://twitter.com/#!/TiBuilt" >tweet a link to your app in the store/market where it resides to TiBuilt</a>.  Sharry will process it and bring it into the fold, and your app skills will be on display for all to see.  Great work Sharry!</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/submit-your-app-built-with-titanium.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internationalization of App Names</title>
		<link>http://developer.appcelerator.com/blog/2012/02/internationalization-of-app-names.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=internationalization-of-app-names</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/internationalization-of-app-names.html#comments</comments>
		<pubDate>Sat, 18 Feb 2012 02:14:10 +0000</pubDate>
		<dc:creator>Tony Lukasavage</dc:creator>
				<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18420</guid>
		<description><![CDATA[Editor&#8217;s Note: This and all further updates to internationalization can be found in the wiki. In the wiki we have pretty extensive documentation on internationalization of application resources. One thing that has been a little tricky for some developers, though, is changing the actual application name based on locale. For example, say you had an [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Editor&#8217;s Note: This and all further updates to internationalization can be found in the <a href="https://wiki.appcelerator.org/display/guides/Internationalization#Internationalization-Internationalizingtheapp'sname">wiki</a>.</strong></p>
<p>In the wiki we have pretty <a href="https://wiki.appcelerator.org/display/guides/Internationalization">extensive documentation on internationalization</a> of application resources. One thing that has been a little tricky for some developers, though, is changing the actual application name based on locale.</p>
<p>For example, say you had an application named <strong>&#8220;Cat&#8221;</strong>, but you wanted it to be <strong>&#8220;Gato&#8221;</strong> in Spanish locales, <strong>&#8220;猫&#8221;</strong> in Japanese, and so on. Let &#8216;s see how you would prepare your application to display its name appropriately for both iOS and Android distributions.</p>
<h2>Changing Locale for Testing</h2>
<p>Before learning to configure your apps to use localized strings for application names, let&#8217;s first see how we can change locales manually for testing. Below you can find short videos for both iOS and Android that show you exactly how to do that.</p>
<table>
<tbody>
<tr>
<td><iframe src="http://player.vimeo.com/video/36991188?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="200" height="387"></iframe></td>
<td><iframe src="http://player.vimeo.com/video/36991208?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="400" height="285"></iframe></td>
</tr>
</tbody>
</table>
<h2>iOS App Name Localization</h2>
<p>For iOS it&#8217;s pretty simple. Use the standard method for creating localization paths, which means creating and using the <code>i18n</code> directory like this (<a href="https://wiki.appcelerator.org/display/guides/Internationalization">details here</a>):</p>
<p><img src="http://developer.appcelerator.com.s3.amazonaws.com/blog/post_images/internationalization/ios_struct.png" width="180"/></p>
<p>In each of your language directories under <code>i18n</code>, you&#8217;ll include an <code>app.xml</code> file that includes the necessary XML structure for defining the localized name of your app. That structure will look like his for each file:</p>
<p><strong>i18n/en/app.xml, i18n/es/app.xml, i18n/ja/app.xml</strong><a name="appxml">&nbsp;</a><br />
<script type="text/javascript" src="https://gist.github.com/1855405.js"></script></p>
<p>And that&#8217;s it. The next time you build your application, these localized strings will be used for your application name. If everything was configured correctly, you&#8217;ll see the app name has changed based on the selected locale.</p>
<h2>Android App Name Localization</h2>
<p>In its current state, Android app name localization is a little more involved. First, we need to create language-specific resource folders explicitly for Android. To do so, we will create the <code>platform/android/res/values-(language code)</code> directory structure, like this:</p>
<p><img src="http://developer.appcelerator.com.s3.amazonaws.com/blog/post_images/internationalization/android_struct.png"  width="180" /></p>
<p>You&#8217;ll notice in this case we are creating the Android native <code>strings.xml</code> files, rather than the <code>app.xml</code> files used by iOS. While the file names are different, the contents will be identical to those in the iOS files <a href="http://developer.appcelerator.com/blog/2012/02/internationalization-of-app-names.html#appxml">seen above</a>.</p>
<p>Aside from the <code>strings.xml</code> files, there&#8217;s one more thing we need to add. To make your app use these localized strings, you need to modify the existing <code>AndroidManifest.xml</code>. In order to do that, We need to add that custom manifest file, seen in the picture above at <code>platform/android/AndroidManifest.xml</code>. The <code>AndroidManifest.xml</code> file placed here should be a copy of the generated <code>AndroidManifest.xml</code> file found in your project&#8217;s <code>build/android</code> directory. For more details on custom <code>AndroidManifest.xml</code> files, check out <a href="https://wiki.appcelerator.org/display/guides/Maintaining+a+Custom+AndroidManifest.xml">this wiki entry</a> on the topic.</p>
<p>Now<a name="customandroid">&nbsp;</a>open up <code>platform/android/AndroidManifest.xml</code> and change the <code>android:label</code> attributes of the <code>&lt;application&gt;</code> and <code>&lt;activity&gt;</code> elements from the defined value of your app name to the value <code>@string/app_name</code>. Yeah, that was a lot of instructions all in one sentence, so here&#8217;s a gist to show you what I mean:</p>
<p><script src="https://gist.github.com/1856408.js?file=AndroidManifest.xml"></script></p>
<p>With these changes in place, you can now rebuild your app (probably best to give it a clean first) and you&#8217;ll have a successfully localized application name.</p>
<h2>For Reference&#8230;</h2>
<p>This is how your home screens might look on Android and iOS when Japanese is the selected language.</p>
<table>
<tr>
<td><img src="http://developer.appcelerator.com.s3.amazonaws.com/blog/post_images/internationalization/android_home.png"/></td>
<td><img src="http://developer.appcelerator.com.s3.amazonaws.com/blog/post_images/internationalization/ios_home.png"/></td>
</tr>
</table>
<p>And just in case my description was clear as mud, check out a Titanium project with these localizations set up first hand. Just go to the <a href="https://github.com/appcelerator-developer-relations/AppNameLocalization">AppNameLocalization project repository on Github</a>. It contains the <i>very</i> basic project discussed here. With all this, you should be well-equipped to distribute your apps in as many languages as you wish to support.</p>
<h2>Links</h2>
<ul style="padding-bottom:20px;">
<li><a href="https://github.com/appcelerator-developer-relations/AppNameLocalization">AppNameLocalization project on Github</a></li>
<li><a href="https://wiki.appcelerator.org/display/guides/Internationalization">Appcelerator Wiki: Internationalization</a></li>
<li><a href="https://wiki.appcelerator.org/display/guides/Maintaining+a+Custom+AndroidManifest.xml">Appcelerator Wiki: Maintaining a Custom AndroidManifest.xml</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/internationalization-of-app-names.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xcode 4.3 and Titanium</title>
		<link>http://developer.appcelerator.com/blog/2012/02/xcode-4-3-and-titanium.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=xcode-4-3-and-titanium</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/xcode-4-3-and-titanium.html#comments</comments>
		<pubDate>Fri, 17 Feb 2012 15:42:33 +0000</pubDate>
		<dc:creator>Kevin Whinnery</dc:creator>
				<category><![CDATA[@en]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18416</guid>
		<description><![CDATA[Apple has recently released Xcode 4.3, which some developers have already started adopting. Please note that per our compatibility matrix here, Xcode 4.2 is the latest Xcode version that can work with Titanium. We are working to add Xcode 4.3 support as soon as we can. An unsupported and untested workaround can be found on [...]]]></description>
			<content:encoded><![CDATA[<p>Apple has recently released Xcode 4.3, which some developers have already started adopting.  Please note that per our <a href="https://wiki.appcelerator.org/display/guides/Titanium+Compatibility+Matrix#TitaniumCompatibilityMatrix-Xcode" >compatibility matrix here</a>, Xcode 4.2 is the latest Xcode version that can work with Titanium.  We are working to add Xcode 4.3 support as soon as we can.</p>
<p>An unsupported and untested workaround can be found <a href="http://developer.appcelerator.com/question/132298/an-ios-sdk-is-missing#comment-114633" >on the Q&#038;A here</a>, but your mileage will vary.  Please refrain from upgrading your Xcode tools to version 4.3 until we can release tooling support for that version.</p>
<p>Thanks, and we&#8217;ll update this post as we have new information.</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/xcode-4-3-and-titanium.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forging Titanium Episode 22: Path-like Menu</title>
		<link>http://developer.appcelerator.com/blog/2012/02/forging-titanium-episode-22-path-like-menu.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=forging-titanium-episode-22-path-like-menu</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/forging-titanium-episode-22-path-like-menu.html#comments</comments>
		<pubDate>Wed, 15 Feb 2012 18:22:26 +0000</pubDate>
		<dc:creator>Tony Lukasavage</dc:creator>
				<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18406</guid>
		<description><![CDATA[Editors note: This and future episodes of Forging Titanium are available here. Today we&#8217;re going to do something a little different with Forging Titanium. We&#8217;re going to take a popular app from the wild and see how we can implement some of its features in Titanium. Today&#8217;s target: the animated menu from the Path mobile [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Editors note: This and future episodes of Forging Titanium are available <a href="http://vimeopro.com/appcelerator/forging-titanium">here</a>.</strong></p>
<p>Today we&#8217;re going to do something a little different with Forging Titanium. We&#8217;re going to take a popular app from the wild and see how we can implement some of its features in Titanium. Today&#8217;s target: the animated menu from the <a href="https://path.com/">Path</a> mobile app.</p>
<p>In this episode we&#8217;ll cover topics like:</p>
<ul style="padding-bottom:20px;">
<li>Advanced animation techniques</li>
<li>Rotating and scaling UI components</li>
<li>Native iOS module development</li>
<li>Cross-platform considerations</li>
<li>Titanium extensibility</li>
</ul>
<p>With these techniques, we&#8217;ll not only show you that Titanium can execute and perform as well as its native counterpart, but also do so from a single code base. </p>
<p><iframe src="http://player.vimeo.com/video/36846582?title=0&amp;byline=0&amp;portrait=0" width="600" height="340" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<h3>Episode Resources:</h3>
<ul style="padding-bottom:20px;">
<li><a href="https://github.com/appcelerator-developer-relations/Forging-Titanium/tree/master/ep-022">Forging Titanium ep-022 github repository</a></li>
<li><a href="https://github.com/tonylukasavage/pathmenu.js">pathmenu.js on Github</a></li>
<li><a href="https://github.com/tonylukasavage/path.animator">path.animator on Github</a></li>
<li><a href="https://path.com/">Path website</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/forging-titanium-episode-22-path-like-menu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Newbie Tuesday: WebView with remote HTML</title>
		<link>http://developer.appcelerator.com/blog/2012/02/newbie-tuesday-web-view.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=newbie-tuesday-webview-with-remote-html</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/newbie-tuesday-web-view.html#comments</comments>
		<pubDate>Wed, 15 Feb 2012 04:50:38 +0000</pubDate>
		<dc:creator>Kevin Whinnery</dc:creator>
				<category><![CDATA[Newbie Tuesday]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18393</guid>
		<description><![CDATA[The following is the latest entry in a series of Tuesday blog posts covering basic topics in Titanium and JavaScript development. A common need in Titanium applications is to display the content of a remote web page inside a web view. Maybe it&#8217;s a blog post linked to in an RSS feed or your own [...]]]></description>
			<content:encoded><![CDATA[<style>
pre {background-color:#ffffff;border-radius:5px;padding:10px;}
</style>
<p><strong>The following is the latest entry in a series of Tuesday blog posts covering basic topics in Titanium and JavaScript development.</strong></p>
<p>A common need in Titanium applications is to display the content of a remote web page inside a web view.  Maybe it&#8217;s a blog post linked to in an RSS feed or your own website &#8211; in any event, you often need to embed that content directly in your app, rather than <a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html" >launching a web page in the device&#8217;s browser</a>.</p>
<p>In order to do this effectively, you should be sure to give the user feedback as the remote site is loading, so they know your app is doing something.  This is especially important for web pages that are not mobile optimized, and tend to load up slowly over a mobile data network.  How you create this UI will vary greatly depending on the nature of your app, but <a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.WebView-object#events" >the events you&#8217;ll listen for on the web view</a> will be the same.  The web view has lifecycle events that will clue you in to the current progress of a web page as it loads.</p>
<p>Let&#8217;s create a simple application with a web view that will load the url given to it in a text field:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> w <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createWindow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'white'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> form <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">60</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#787878'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
w.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>form<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> urlField <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createTextField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	value<span style="color: #339933;">:</span><span style="color: #3366CC;">'http://www.cnn.com'</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	left<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	right<span style="color: #339933;">:</span><span style="color: #CC0000;">120</span><span style="color: #339933;">,</span>
	bottom<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	borderStyle<span style="color: #339933;">:</span>Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">INPUT_BORDERSTYLE_ROUNDED</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
form.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>urlField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> btn <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">110</span><span style="color: #339933;">,</span>
	right<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	bottom<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	title<span style="color: #339933;">:</span><span style="color: #3366CC;">'Go'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
form.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>btn<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> webView <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createWebView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	url<span style="color: #339933;">:</span><span style="color: #3366CC;">'http://www.cnn.com'</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">60</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
w.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>webView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
w.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Which will look like this on iOS and Android:</p>
<p><img src="http://img.skitch.com/20120215-qkbjm4hm54eg78mmbiig39dwqj.png"/></p>
<p>Now, let&#8217;s expand that application with a modal loading state we&#8217;d like to display as the page loads by adding an opaque view to the main window:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> overlay <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#cdcdcd'</span><span style="color: #339933;">,</span>
	opacity<span style="color: #339933;">:</span><span style="color: #CC0000;">0.75</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
overlay.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createLabel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	height<span style="color: #339933;">:</span><span style="color: #3366CC;">'auto'</span><span style="color: #339933;">,</span>
	width<span style="color: #339933;">:</span><span style="color: #3366CC;">'auto'</span><span style="color: #339933;">,</span>
	text<span style="color: #339933;">:</span><span style="color: #3366CC;">'Loading...'</span><span style="color: #339933;">,</span>
	color<span style="color: #339933;">:</span><span style="color: #3366CC;">'#787878'</span><span style="color: #339933;">,</span>
	font<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
		fontSize<span style="color: #339933;">:</span><span style="color: #CC0000;">24</span><span style="color: #339933;">,</span>
		fontWeight<span style="color: #339933;">:</span><span style="color: #3366CC;">'bold'</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
w.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>overlay<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Which should look like:</p>
<p><img src="http://img.skitch.com/20120215-1bp78hn39x6y6ma7w6eht3axtw.png"/></p>
<p>Next, let&#8217;s add some logic around the button click and the web view&#8217;s &#8220;load&#8221; event to toggle the overlay.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">btn.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	urlField.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	webView.<span style="color: #660066;">url</span> <span style="color: #339933;">=</span> urlField.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
	overlay.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
webView.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'load'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	overlay.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Our little web browser is now complete!  Drop this complete sample in app.js to see it in action:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> w <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createWindow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'white'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> form <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">60</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#787878'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
w.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>form<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> urlField <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createTextField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	value<span style="color: #339933;">:</span><span style="color: #3366CC;">'http://www.cnn.com'</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	left<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	right<span style="color: #339933;">:</span><span style="color: #CC0000;">120</span><span style="color: #339933;">,</span>
	bottom<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	borderStyle<span style="color: #339933;">:</span>Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">INPUT_BORDERSTYLE_ROUNDED</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
form.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>urlField<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> btn <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">110</span><span style="color: #339933;">,</span>
	right<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	bottom<span style="color: #339933;">:</span><span style="color: #CC0000;">5</span><span style="color: #339933;">,</span>
	title<span style="color: #339933;">:</span><span style="color: #3366CC;">'Go'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
form.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>btn<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> webView <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createWebView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	url<span style="color: #339933;">:</span><span style="color: #3366CC;">'http://www.cnn.com'</span><span style="color: #339933;">,</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">60</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
w.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>webView<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> overlay <span style="color: #339933;">=</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#cdcdcd'</span><span style="color: #339933;">,</span>
	opacity<span style="color: #339933;">:</span><span style="color: #CC0000;">0.75</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
overlay.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createLabel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	height<span style="color: #339933;">:</span><span style="color: #3366CC;">'auto'</span><span style="color: #339933;">,</span>
	width<span style="color: #339933;">:</span><span style="color: #3366CC;">'auto'</span><span style="color: #339933;">,</span>
	text<span style="color: #339933;">:</span><span style="color: #3366CC;">'Loading...'</span><span style="color: #339933;">,</span>
	color<span style="color: #339933;">:</span><span style="color: #3366CC;">'#787878'</span><span style="color: #339933;">,</span>
	font<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
		fontSize<span style="color: #339933;">:</span><span style="color: #CC0000;">24</span><span style="color: #339933;">,</span>
		fontWeight<span style="color: #339933;">:</span><span style="color: #3366CC;">'bold'</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
w.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>overlay<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
btn.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	urlField.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	webView.<span style="color: #660066;">url</span> <span style="color: #339933;">=</span> urlField.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
	overlay.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
webView.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'load'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	overlay.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
w.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Hope that helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/newbie-tuesday-web-view.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Featured Developer – Ben Bahrenburg</title>
		<link>http://developer.appcelerator.com/blog/2012/02/featured-developer-ben-bahrenburg.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=featured-developer-ben-bahrenburg</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/featured-developer-ben-bahrenburg.html#comments</comments>
		<pubDate>Mon, 13 Feb 2012 22:56:06 +0000</pubDate>
		<dc:creator>sharry</dc:creator>
				<category><![CDATA[@en]]></category>
		<category><![CDATA[Ben Bahrenburg]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18347</guid>
		<description><![CDATA[Editor&#8217;s note: Sharry Stowell is the editor of Learning Titanium, where he frequently comments on the latest contributions of the Titanium community. Over the previous few months I&#8217;ve noticed a few developers in the Titanium community shine brighter and brighter. They&#8217;ve helped out on the Q&#038;A forum, answered questions over IRC, shared the latest Titanium [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Editor&#8217;s note: Sharry Stowell is the editor of <a href="http://www.learningtitanium.com/" >Learning Titanium</a>, where he frequently comments on the latest contributions of the Titanium community.</strong></p>
<p>Over the previous few months I&#8217;ve noticed a few developers in the Titanium community shine brighter and brighter. They&#8217;ve helped out on the Q&amp;A forum, answered questions over IRC, shared the latest Titanium news and even created modules for the <a href="http://marketplace.appcelerator.com/">Appcelerator MarketPlace</a> for all to use and enjoy. The Titanium developer of the week has to go to <strong>Ben Bahrenburg</strong> for his outstanding contribution to the community.</p>
<p>Ben has over 14 years experience in systems, software and module development. Starting out as a Oracle DBA, then moved onto focus on DSL base high volume payroll transactions for PriceWaterhouseCoopers.</p>
<h3>Interview with Ben Bahrenburg</h3>
<p>A few weeks ago I had an interview with Ben and asked him a few question about Titanium, here is what he said:</p>
<blockquote><p><strong>How did you get involved in Titanium development?</strong></p>
<p>I found Titanium about three years ago through Twitter. After a couple of weekends experimenting with the API, I was hooked. It was impressive even back then how quickly you could build apps.</p></blockquote>
<blockquote><p><strong>Do you have any Apps created in Titanium?</strong></p>
<p>Like most Titanium developers I&#8217;ve created a ton of apps over the years. The two most notable are <a href="http://developer.appcelerator.com/blog/2011/04/aidori-relief-app-for-japan.html">Aidori</a> an app to help with the Japan 2011 Earthquake, and <a href="https://github.com/benbahrenburg/bARk">bARk</a> an open source augmented reality app that was used in a session at last year&#8217;s <a href="http://codestrong.com/">CodeStrong</a> conference.</p>
<p>A majority of the apps and frameworks I&#8217;ve created are for my employer. The most notable of these is the myTravel app which is featured in a recent Appcelerator case study.</p></blockquote>
<blockquote><p><strong>How are you involved in the Titanium Community?</strong></p>
<p>There has always been a great community around Titanium. Back in the 0.4 days Jeff and Nolan would answer most support questions themselves. In this spirit I help out in the <a href="http://developer.appcelerator.com/questions/newest">Q&amp;A forums</a>, on community project, and over <a href="http://twitter.com/bencoding">Twitter</a> as much as possible.</p>
<p>Whenever I run into an interesting problem in the <a href="http://developer.appcelerator.com/questions/newest">QA forum</a> or on my own projects I create tutorials on my blog <a href="http://bencoding.com">bencoding.com</a> or post samples to <a href="https://github.com/benbahrenburg">github</a>.</p>
<p>The Titanium Titan program has provided the chance to talk about Titanium at several hackathons and user groups. This has been a great opportunity to code and learn from the Titanium community. It has become a personal mission of mine to pair program with as much of the Titanium community as possible. This has been a great way to both learn and give back.</p></blockquote>
<blockquote><p><strong>Do you have any experience in Titanium Module creation?</strong></p>
<p>I&#8217;ve created a few commonJS format modules.</p>
<p><a href="https://github.com/benbahrenburg/TiTaffyDb">TiTaffyDb</a> &#8211; A Titanium port of the populator NoSQL JavaScript database<br />
<a href="https://github.com/benbahrenburg/Soup">Soup</a> &#8211; A framework for working with Geo Location based content providers<br />
<a href="https://github.com/benbahrenburg/Atlas">Atlas</a> &#8211; A Geo Location framework, that allows for chaining, provider rating, and fallbacks.</p>
<p>The Titanium module architecture make is relatively easy to plugin native modules. I have a few native iOS modules I hope to make available once iOS 5.1 ships.</p></blockquote>
<blockquote><p><strong>What&#8217;s your favorite platform to develop in? Any plans to expand?</strong></p>
<p>I enjoy the challenge of building for tablets. Until just recently that meant the iPad but now with the Kindle Fire and Windows 8 Metro it is starting to be more exciting from a cross platform point of view.</p>
<p>Over the last month I have been experimenting to see how much code re-use I can achieve using Titanium on the Kindle Fire and WinJS on Windows 8. So far the results have been limited but encouraging. From a Titanium devs point of view WinJS feels similar and provides a great level of skill reuse.</p></blockquote>
<h3>Modules</h3>
<p>Since taking part the interview, Ben has been busy trying a new challenge &#8211; <em>to release a module each Monday for a month</em>! So far he has created 3 great modules, with a few more to come too:</p>
<h3>NETWORK HELPERS MODULE</h3>
<p>TiNetworkHelpers is a module that provides support for Carrier information, SSID, BSSID, and Apple&#8217;s Reachability utility class. Its currently only available on iOS, with Android support coming shortly:</p>
<h4>1. CarrierInfo &#8211; Provides access to the native CTTelephonyNetworkInfo framework object</h4>
<ul>
<li><strong>carrierName</strong> – Provides access to the carrier name associated with the device&#8217;s SIM.</li>
<li><strong>mobileCountryCode</strong> – Provides access to the carrier Mobile Country Codes (MCCs). This is the country code associated with the carrier on the SIM</li>
<li><strong>mobileNetworkCode</strong> – Provides access to the carrier&#8217;s Mobile Network Code. This is the network code associated with the carrier on the SIM</li>
<li><strong>isoCountryCode</strong> – The ISO country code for the user’s cellular service provider. This is the carrier on the SIM</li>
<li><strong>allowsVOIP</strong> – Indicates if the carrier allows VoIP calls to be made on its network</li>
</ul>
<p><a href="https://gist.github.com/1701720"><img src="http://img846.imageshack.us/img846/5289/benbcarriermodule1.jpg" alt="CarrierInfo" /></a></p>
<h4>2. CurrentNetwork &#8211; Provides access to the native CNCopyCurrentNetworkInfo object</h4>
<ul>
<li><strong>SSID</strong> – Provides access the <span title="Service Set IDentifier">SSID</span> the device is currently connected</li>
<li><strong>BSSID</strong> – Provides access the <span title="Sasic Service Set IDentifier">BSSID</span> the device is currently connected</li>
</ul>
<p><a href="https://gist.github.com/1701720"><img src="http://img217.imageshack.us/img217/7287/benbcarriermodule2.jpg" alt="CurrentNetwork" /></a></p>
<h4>3. Reachability &#8211; Provides a wrapper for the Apple Reachability module</h4>
<ul>
<li><strong>reachabilityForLocalWiFi</strong> – This method provides a boolean result if Local Wifi is enabled</li>
<li><strong>reachabilityWithHostName</strong> – This method takes a host name, such as www.appcelerator.com and returns a boolean result if the host is reachable</li>
<li><strong>hostNameReachableBy</strong> – This method takes a host name, such as www.appcelerator.com and returns a constant with how it is reachable</li>
</ul>
<p><a href="https://gist.github.com/1701720"><img src="http://img96.imageshack.us/img96/6225/benbcarriermodule3.jpg" alt="Reachability" /></a><br />
Useful links: <a href="http://bencoding.com/2012/01/30/tinetworkhelpers-titanium-module-for-carrierinfo-currentnetwork-more/">BLOG POST</a> | <a href="https://github.com/benbahrenburg/TiNetworkHelpers/">CODE</a> | <a href="https://marketplace.appcelerator.com/apps/1948">MARKETPLACE</a></p>
<hr />
<h3>TITANIUM DICTIONARY MODULE</h3>
<p>What to use the native iOS5 Dictionary in your Titanium Mobile app? The new benCoding.Dictionary module that makes it easy to this functionality into any Titanium app that targets iOS5 or greater.</p>
<p><a href="https://gist.github.com/1814600"><img src="http://img835.imageshack.us/img835/6383/benbdictionarymodule1.jpg" alt="Dictionary module" /></a></p>
<p><iframe width="450" height="338" src="http://www.youtube.com/embed/3ruH3eI-AU4?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Useful links: <a href="http://bencoding.com/2012/02/06/titanium-dictionary-module/">BLOG POST</a> | <a href="https://github.com/benbahrenburg/benCoding.Dictionary">CODE</a> | <a href="https://marketplace.appcelerator.com/apps/1947">MARKETPLACE</a></p>
<hr />
<h3>TITANIUM SMS MODULE</h3>
<p>The benCoding.SMS module makes it easy to add SMS functionality into your iOS Titanium apps. We unleash the power of Apple’s native Apple SMS component to Titanium with an API fashioned after the Titanium EmailDialog to make it familiar to use.  </p>
<p><a href="https://gist.github.com/1814562"><img src="http://img525.imageshack.us/img525/7514/benbsmsmodule1.jpg" alt="SMS module" /></a></p>
<p><a href="http://img718.imageshack.us/img718/6563/benbsmsmodule2.png" title="Click to maximize"><img src="http://img718.imageshack.us/img718/6563/benbsmsmodule2.png" alt="" width="200" /></a><a href="http://img525.imageshack.us/img525/4266/benbsmsmodule3.png" title="Click to resize"><img src="http://img525.imageshack.us/img525/4266/benbsmsmodule3.png" width="200" /></a><a href="http://img51.imageshack.us/img51/2162/benbsmsmodule4.png" title="Click to resize"><img src="http://img51.imageshack.us/img51/2162/benbsmsmodule4.png" alt="" width="200" /></a></p>
<p>Useful links: <a href="http://bencoding.com/2012/02/12/titanium-sms-module/">BLOG POST</a> | <a href="https://github.com/benbahrenburg/benCoding.SMS">CODE</a> | <a href="https://marketplace.appcelerator.com/apps/1973" title="">MARKETPLACE</a></p>
<hr />
As you can see from above, Ben has been extra busy! Please remember all these modules are FREE to use and are available within the <a href="https://marketplace.appcelerator.com/">Appcelerator Marketplace</a>. </p>
<p>If you have have developed an App in Titanium, a module for Titanium or just have some news you wish to share with the community please head on over to <a href="http://www.learningtitanium.com" title="Checkout LeanringTitanium.com">LearningTitanium.com</a> or follow me on Twitter <a href="http://www.twitter.com/learningti">here</a>.</p>
<p>Code strong!</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/featured-developer-ben-bahrenburg.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Win up to $5K hacking Titanium apps with Box</title>
		<link>http://developer.appcelerator.com/blog/2012/02/win-hacking-titanium-apps-with-box.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=win-up-to-5k-hacking-titanium-apps-with-box</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/win-hacking-titanium-apps-with-box.html#comments</comments>
		<pubDate>Fri, 10 Feb 2012 22:20:33 +0000</pubDate>
		<dc:creator>Kevin Whinnery</dc:creator>
				<category><![CDATA[@en]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18339</guid>
		<description><![CDATA[Titanium developers have a great opportunity to score up to $5000 cash money in two developer challenges, sponsored by Box. The first is a challenge open only to Titanium developers, offering up to $1250 in prize money for the best Titanium apps making use of the new, open source Box CommonJS module. Sign up here [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cloudspokes.com/challenges/1372"><img src="http://cs-production.s3.amazonaws.com/challenges/1372/box-appcelerator-logo.png"/></a></p>
<p>Titanium developers have a great opportunity to score up to $5000 cash money in two developer challenges, sponsored by <a href="http://box.com/" >Box</a>.  The first is a challenge open only to Titanium developers, offering up to $1250 in prize money for the best Titanium apps making use of the new, <a href="https://github.com/aaronksaunders/appcelerator_box_com" >open source Box CommonJS module</a>.</p>
<p><a href="http://www.cloudspokes.com/challenges/1372" >Sign up here for the Titanium-only Box developer contest</a>.</p>
<p>Box is also putting out a call for the best iPad application &#8211; native or otherwise &#8211; utilizing the Box APIs.  We have a feeling a Titanium app could win this one as well :).  </p>
<p><a href="http://www.cloudspokes.com/challenges/1379" >Sign up here for the iPad Box developer contest</a>.</p>
<p>To help bootstrap your Box development knowledge, <a href="http://developer.appcelerator.com/blog/2012/02/forging-titanium-episode-21-box-module-for-cloud-storage.html" title="Forging Titanium Episode 21: Box Module for Cloud Storage" >please check out this week&#8217;s episode of Forging Titanium</a>, which covers the usage of the new Box module.  Good luck, and we can&#8217;t wait to see what you come up with!</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/win-hacking-titanium-apps-with-box.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Encryption and Full-Text Indexing with Titanium Mobile</title>
		<link>http://developer.appcelerator.com/blog/2012/02/sql-encryption-and-full-text-indexing-with-titanium-mobile.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sql-encryption-and-full-text-indexing-with-titanium-mobile</link>
		<comments>http://developer.appcelerator.com/blog/2012/02/sql-encryption-and-full-text-indexing-with-titanium-mobile.html#comments</comments>
		<pubDate>Thu, 09 Feb 2012 17:32:11 +0000</pubDate>
		<dc:creator>Mark Burggraf</dc:creator>
				<category><![CDATA[@en]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Marketplace]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://developer.appcelerator.com/blog/?p=18307</guid>
		<description><![CDATA[Editor&#8217;s note: This is a guest post from community member and contributor Mark Burggraf, on his latest addition to the module marketplace. Would you like to contribute a guest post? E-Mail us at community@appcelerator.com to let us know! Our new custom module for Titanium, &#8220;SQL Encryption and Full-Text Indexing&#8221; allows you to create and maintain [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Editor&#8217;s note: This is a guest post from community member and contributor Mark Burggraf, on his latest addition to the module marketplace.  Would you like to contribute a guest post?  E-Mail us at community@appcelerator.com to let us know!</strong></p>
<p>Our new custom module for Titanium, &#8220;<a href="https://marketplace.appcelerator.com/apps/1924">SQL Encryption and Full-Text Indexing</a>&#8221; allows you to create and maintain AES encrypted databases in your applications using SQLCipher technology.  To quote from the SQLCipher web site: &#8220;SQLCipher is an SQLite extension that provides transparent 256-bit AES encryption of database files. Pages are encrypted before being written to disk and are decrypted when read back. Due to the small footprint and great performance it’s ideal for protecting embedded application databases and is well suited for mobile development.&#8221;</p>
<p>Let&#8217;s build a mobile project in Titanium for Android that uses encryption and full-text indexing.</p>
<p><strong>Step 1</strong>: Create your empty project.  We&#8217;ll assume here that you have Titanium Studio running, with Titanium Mobile SDK 1.8.1, and the Android SDK already installed and configured.  We called our project &#8220;SQLEncryption&#8221;.</p>
<p><strong>Step 2:</strong> Copy the module zip file into the root of your project.  The module zip file should be named:  com.dmarie.sql-android-2.1.zip.</p>
<div class="wp-caption alignnone" style="width: 273px"><img src="http://dmarie.com/sqlencryptiontutorial/Screen1_zipfile.png" alt="Add zip file to project" width="263" height="263" /><p class="wp-caption-text">Add zip file to project</p></div>
<p><strong>Step 3:</strong> Run your project in the Android emulator.  The first time you run your project, you&#8217;ll see the zip file disappear from the root of your project.  Titanium Studio will unzip the module and place it in /modules/android/com.dmarie.sql/2.1, as seen here:</p>
<div class="wp-caption alignnone" style="width: 254px"><img src="http://dmarie.com/sqlencryptiontutorial/Screen2_expanded_module.png" alt="Expanded Module" width="244" height="324" /><p class="wp-caption-text">Module is expanded into the project</p></div>
<p><strong>Step 4:</strong> Add a module reference to your tiapp.xml line.  Open your tiapp.xml file in Titanium Studio, click the &#8220;tiapp.xml&#8221; tab to edit the xml version of the file, then scroll to the bottom of the file.<br />
Remove the line:</p>
<pre> &lt;modules/&gt;</pre>
<p>And replace it with these lines:</p>
<pre> &lt;modules&gt;
    &lt;module version="2.1"&gt;com.dmarie.sql&lt;/module&gt; 
 &lt;/modules&gt;</pre>
<p><strong>Step 5:</strong> Copy the CommonJS module &#8220;db.js&#8221; from the /modules/android/com.dmarie.sql/2.1/example folder to your /Resources folder.  This CommonJS module makes it much easier to use our encryption module, and it also provides compatibility with most existing SQLite code you may have already written.</p>
<p><strong>Step 6:</strong> Edit your app.js file.<br />
Remove all the contents and replace it with the following 6 lines &#8212; (we&#8217;re just going to make a simple scrolling screen here):</p>
<pre>var win1 = Titanium.UI.createWindow({backgroundColor:'#fff'});
var scrollView = Titanium.UI.createScrollView({});
var label = Titanium.UI.createLabel({ color:"black"  });
scrollView.add(label);
win1.add(scrollView);
win1.open();</pre>
<p>Now we can simply say:</p>
<pre>label.text += "add text here\n";</pre>
<p>when we want to write entries to our scrolling screen.</p>
<p><strong>Step 7:</strong> Add a reference to our CommonJS module db.js:</p>
<pre>var db = require("db");</pre>
<p><strong>Step 8:</strong> Open an encrypted database, create a table, and add data to it:</p>
<pre>label.text += "databases will be stored here: " + db.dbPath + "\n";
label.text += "open encrypted.db, create a table, then add a record...\n";
var maindb = db.openDB("encrypted.db", "my secret password");
maindb.execute("create table if not exists people (name TEXT)");
maindb.execute("insert into people (name) values ('John Smith')");
maindb.execute("insert into people (name) values ('John Adams')");
maindb.execute("insert into people (name) values ('Peter Tork')");</pre>
<p>Some things to note here &#8211;</p>
<ul>
<li>If the file &#8220;encrypted.db&#8221; does not exist, it will be created automatically.</li>
<li>Databases will be created and opened in the folder specified by db.dbPath.  (You can set this to any folder you like inside db.js.)</li>
<li>If you want to distribute a database with your application, you&#8217;ll need to manually copy it to the folder specified by db.dbPath before you can use it.  There is no equivalent to the Titanium.Database.install command, so installing your data file is up to you.</li>
<li>The second parameter of db.openDB accepts one of three things:</li>
<ul>
<li>&#8220;&#8221; (an empty string) &#8211; this will create an unencrypted, normal SQLite database</li>
<li>&#8220;DEFAULT&#8221; &#8211; if you send the literal word DEFAULT, the password used will be the value returned by Titanium.App.guid</li>
<li>&#8220;any password you choose&#8221; &#8211; anything else you send will be considered a password (encryption key) for the database</li>
</ul>
</ul>
<div></div>
<div>It&#8217;s important to note that your data is never going to be 100% secure as long as the encryption key you&#8217;re using is stored in a place where a potential hacker has easy access to it.  In our example here, it may be easy for a hacker to locate &#8220;my secret password&#8221; by perusing  your application files.  If security is very important to you, you&#8217;ll need to find some other safe way to store your key.  Here are some suggestions:</div>
<div></div>
<ul>
<li>Use a complex key created by manipulating text from multiple sources, adding salt, doing bitwise manipulation, etc.</li>
<li>Hide the key by using a sequence of bytes stored in a binary file that&#8217;s already included with your application.  You can read your binary file into a buffer and extract out a per-determined sequence of bytes that either comprises your key, or just a portion of your key.</li>
<li>Don&#8217;t store the key with your application at all &#8212; instead open an ssl data connection to your secure server and get the key over the network at runtime.</li>
</ul>
<div></div>
<p>There are many ways to secure your key (if that&#8217;s important to you) but that task is up to you.</p>
<p><strong>Step 9:</strong> Open a cursor and extract some data:</p>
<pre>label.text += "open a cursor and extract some data:\n";
var rows = maindb.execute("select name from people");
label.text += rows.length + " rows were found:\n";
while (rows.isValidRow())
{    
    label.text += "name: " + rows.fieldByName("name") + "\n";
    rows.next();
}</pre>
<p><strong>Step 10:</strong> Create a full-text index using FTS3 (see http://www.sqlite.org/fts3.html):</p>
<pre>maindb.execute("create virtual table FT USING fts3(name TEXT)");
maindb.execute("insert into FT (rowid,name) select rowid,name from people");</pre>
<p><strong>Step 11:</strong> Query the full-text index and print some results:</p>
<pre>label.text += "testing full-text index:\n";
var srch = maindb.execute("select name,rowid from FT where name match 'john'"); // uses FTS3 index for speed
while (srch.isValidRow())
{
    label.text += srch.fieldByName("name") + " found at rowid " + srch.fieldByName("rowid") + "\n";
    srch.next();       
}</pre>
<p>Let&#8217;s look at the database now and see if it&#8217;s really encrypted.  To compare our encrypted database to a regular, un-encrypted version, let&#8217;s run this app twice.  We&#8217;ll create two databases, an un-encrypted version and an encrypted version.</p>
<p>First, let&#8217;s change the location of our databases to something easier to find.  Find the openDB line of code and change it to:</p>
<pre>db.dbPath = "/sdcard/"; // this will put databases in the root of the sdcard
var maindb = db.openDB("unencrypted.db", "");</pre>
<p>Now run the app. This should create an unencrypted database in the root of your sdcard.</p>
<p>Now change the openDB line to this and run the app again:</p>
<pre>var maindb = db.openDB("encrypted.db", "foo");</pre>
<p>Let&#8217;s see the results of our work.  Open a terminal session (assuming you&#8217;re running OSX here) and pull the databases off your sdcard image so we can look at them:</p>
<pre>$ adb -e pull /sdcard/unencrypted.db .
$ adb -e pull /sdcard/encrypted.db .</pre>
<p>You&#8217;ll need to have the Android adb tool on your path.  If it&#8217;s not on your path, you&#8217;ll have to specify a full path to adb.  At this point, you should have two files in your current folder named encrypted.db and unencrypted.db.</p>
<p>Try opening the unencrypted version with sqlite3:</p>
<pre>$ sqlite3 unencrypted.db
SQLite version 3.6.21
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite&gt; .tables
people
sqlite&gt; .exit</pre>
<p>So we can see the &#8220;people&#8221; table just fine &#8212; no encryption here!  Let&#8217;s do the same with the encrypted database:</p>
<pre>$ sqlite3 encrypted.db
SQLite version 3.6.21
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite&gt; .tables
Error: file is encrypted or is not a database
sqlite&gt; .exit</pre>
<p>This database is encrypted alright.  Let&#8217;s do a hexdump and prove that it&#8217;s encrypted:</p>
<pre>$ hexdump -C unencrypted.db</pre>
<p>Looking at the output, it&#8217;s easy to see our data:</p>
<div class="wp-caption alignnone" style="width: 561px"><img src="http://dmarie.com/sqlencryptiontutorial/hexdump1.png" alt="Hex dump of unencrypted database" width="551" height="364" /><p class="wp-caption-text">Hex dump of unencrypted database</p></div>
<p>Let&#8217;s do the same with the encrypted file:</p>
<pre>$ hexdump -C encrypted.db</pre>
<p>You&#8217;ll just see a long stream of encrypted bytes here:</p>
<div class="wp-caption alignnone" style="width: 560px"><img src="http://dmarie.com/sqlencryptiontutorial/hexdump2.png" alt="Hex dump of encrypted database" width="550" height="255" /><p class="wp-caption-text">Hex dump of encrypted database</p></div>
]]></content:encoded>
			<wfw:commentRss>http://developer.appcelerator.com/blog/2012/02/sql-encryption-and-full-text-indexing-with-titanium-mobile.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

