<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Ibuildings Blog</title>
	
	<link>http://ibuildings.nl/blog</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Wed, 08 May 2013 08:53:53 +0000</lastBuildDate>
	<language />
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Ibuildingsblog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="ibuildingsblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Verifying our software with OWASP ASVS</title>
		<link>http://ibuildings.nl/blog/2013/03/verifying-software-with-owasp-asvs/</link>
		<comments>http://ibuildings.nl/blog/2013/03/verifying-software-with-owasp-asvs/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 08:15:05 +0000</pubDate>
		<dc:creator>Boy Baukema</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4345</guid>
		<description><![CDATA[&#8220;If a tree falls in a forest and no one is around to hear it, does it make a sound?&#8220; Likewise if a software project is delivered and no one has looked at security, can it be said to be secure? If a tree falls&#8230; by Dunc(an) When a customer commissions Ibuildings for a new application, he [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><a href="http://en.wikipedia.org/wiki/If_a_tree_falls_in_a_forest">&#8220;<strong>If a tree falls in a forest and no one is around to hear it, does it make a sound?</strong>&#8220;</a></p></blockquote>
<p>Likewise if a software project is delivered and no one has looked at security, can it be said to be secure?</p>
<p><a href="http://www.flickr.com/photos/duncanh1/5106682899/"><img src="http://farm2.staticflickr.com/1239/5106682899_9e87a5b1af.jpg" alt="" width="500" height="375" /></a>If a tree falls&#8230; by Dunc(an)</p>
<p>When a customer commissions Ibuildings for a new application, he usually has plenty of functional demands (I need it to do X and also Y and Z&#8230; oh and can I get A?).<br />
And maybe some thoughts have been given to performance metrics, but security?</p>
<p>Well&#8230; it &#8220;needs to be secure&#8221;.<br />
<span id="more-4345"></span></p>
<h2>What is &#8216;secure&#8217; anyway?</h2>
<p>It is said, conveniently enough mostly by software engineers, that building software is perhaps one of the most complex activities that humans have ever undertaken.<br />
Looking at some of the questions one might ask an engineer on secure coding, you get the idea that these software engineers may have a point:</p>
<ul>
<li>Have you encoded all output? What is output anyway? Is what we send to our own database output? And Redis?</li>
<li>Have you filtered all input? What is input anyway? Is what we get from our own database considered input ? Is what we get from a third party news feed or SOAP service?</li>
<li>Is <strong>every</strong> unsafe action protected from Cross Site Request Forgery?</li>
<li>Is <strong>every</strong> AJAX call that requires authorisation protected from access by unauthorised users?</li>
<li>Are <strong>all</strong> your expensive operations rate limited to prevent Denial Of Service attacks?</li>
<li>Are passwords stored &#8216;securely&#8217;? Securely being salted (with user specific salts) Blowfish encrypted values with significant rounds?</li>
<li>How safe is third party software used? Who applies security patches?</li>
</ul>
<p>I would say &#8216;etcetera&#8217; here, but it doesn&#8217;t quite cover how many questions one can ask of engineers when they build an application.</p>
<p>To help our engineers we currently do the following:</p>
<ol>
<li>Hold regular Web Application Security workshops where we remind old staff and inform new staff of application threats.</li>
<li>Hold frequent code reviews, and will be working with the GitHub Pull Request system to make sure no unverified code makes it to master.</li>
<li>Have a Secure Software Specialist dedicate time to helping the company release secure software.</li>
</ol>
<p>But even with that, I have a saying:</p>
<blockquote class="twitter-tweet"><p>Repeat after me: &#8220;If it hasn&#8217;t been tested, it doesn&#8217;t work.&#8221; And: &#8220;If it hasn&#8217;t been documented it doesn&#8217;t exist&#8221;</p>
<p>— relaxnow (@relaxnow) <a href="https://twitter.com/relaxnow/status/8540326331">February 2, 2010</a></p></blockquote>
<h2>Security isn&#8217;t a checkbox, it&#8217;s a dropdown</h2>
<p>Remember all those questions we asked the engineer on secure coding?<br />
Turns out engineers don&#8217;t have a fixed set of questions they ask themselves. Team Leads don&#8217;t have a specific set of questions they ask their engineers. Customers hire security auditors (<a title="Ibuildings Security" href="http://ibuildings.nl/technologie/security/">like us</a>) and they <strong>all</strong> have their own set of questions.</p>
<p>In order to help organisations come to an agreement on what should be the &#8216;minimal&#8217; required set of questions to ask, several people got together and created the <a title="OWASP ASVS" href="https://www.google.nl/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CDkQFjAA&amp;url=https%3A%2F%2Fwww.owasp.org%2Findex.php%2FCategory%3AOWASP_Application_Security_Verification_Standard_Project&amp;ei=4thBUazKE9HK0AXJiIHICw&amp;usg=AFQjCNE9ycm9geRYp2Zb83RHB71_PZRv6g&amp;bvm=bv.43287494,d.d2k">Application Security Verification Standard (ASVS) project</a> and donated it to the <a title="OWASP.org" href="https://www.owasp.org/index.php/Main_Page">Open Web Application Security Project (OWASP)</a>.</p>
<p>From the introduction:</p>
<blockquote><p>The standard provides a basis for testing application technical security controls, as well as any technical security controls in the environment, that are relied on to protect against vulnerabilities such as Cross-Site Scripting (XSS) and SQL injection. This standard can be used to establish a level of confidence in the security of Web applications.</p></blockquote>
<p>ASVS gives the customer, and us, a negiotable &#8216;Security Minimum&#8217; that can be verified.</p>
<p>It defines 4 levels of rigor:</p>
<ol>
<li><strong>Automated</strong> verification, a &#8216;quick&#8217; automated (dynamic and static) check of only of the custom code.</li>
<li><strong>Manual</strong> verification, a &#8216;normal&#8217; check, verify all custom code and security relevant third party code manually.</li>
<li><strong>Design</strong> verification, a &#8216;business-critical&#8217; check, verify all custom and all third party code.</li>
<li><strong>Internal</strong> verification, a &#8216;life-or-death-critical&#8217; check, every piece of code that touches the application (including build tools).</li>
</ol>
<p>And 14 chapters:</p>
<ol>
<li><span style="line-height: 13px;"><strong>Security Architecture Documentation</strong>, you have documented all requirements and third party components in your code&#8230; right?</span></li>
<li><strong>Authentication</strong>, it&#8217;s okay to cheat with the <a title="OWASP Authentication Cheat Sheet" href="https://www.owasp.org/index.php/Authentication_Cheat_Sheet">OWASP Cheat Sheet</a>.</li>
<li><strong>Session Management</strong>, session timeouts are a good thing.</li>
<li><strong>Access Control</strong>, if I upload a private picture, can only I access it?</li>
<li><strong>Input Validation</strong>, rule number one.</li>
<li><strong>Output Encoding</strong>, rule number two.</li>
<li><strong>Cryptography</strong>, &#8220;Applications should always use FIPS 140-2 validated cryptographic modules, or cryptographic modules validated against an equivalent standard&#8221;</li>
<li><strong>Error handling and logging</strong>, should someone get through your defenses, can you track what they did?</li>
<li><strong>Data protection</strong>, how do you protect sensitive information?</li>
<li><strong>Communication Security</strong>, have you properly implemented SSL?</li>
<li><strong>HTTP Security</strong>, &#8220;a set of requirements that can be used to verify security related to HTTP requests, responses, sessions, cookies, headers, and logging&#8221;</li>
<li><strong>Security Configuration</strong>, have you stored your configuration in a safe place?</li>
<li><strong>Malicious Code Search</strong>, was anyone able to inject malicous code?</li>
<li><strong>Internal Security</strong>, it should be hard to mess up.</li>
</ol>
<p>Every chapter defines it&#8217;s own set of rules and the levels pick and chose from these (level 1 will only pick the first simple requirements from each chapter, while level 4 will require them all).</p>
<p>At Ibuildings we pick a level with the customer at the start of a project. So far, we haven&#8217;t seen too many medical or life-critical projects, so they tend to be level 1 or 2.<br />
And we make sure to verify that the project complies before the final go-live.</p>
<p>Now let me make this clear, as an engineer myself, we don&#8217;t look at a requirement like:</p>
<blockquote><p>V5.7 Verify that all input validation failures are logged.</p></blockquote>
<p>and say &#8220;Well, that&#8217;s a 2B requirement that is. This project is Level 1 only, so no logging for this app!&#8221;.</p>
<p>Where feasible, engineers will always hold themselves to the highest standards.<br />
But we certainly won&#8217;t rewrite a third party application to support this rule, unless the customer explicitly wants us too.</p>
<h2>Security still is not a solved problem</h2>
<p>While ASVS is a wonderful addition, it has it&#8217;s issues:</p>
<ol>
<li>Verification and reporting, done to it&#8217;s fullest extent, can take a significant amount of time.</li>
<li>Verification rules are not specific enough in use of tools and techniques.</li>
<li>It is slightly outdated (2009).</li>
</ol>
<p>The first and second issue are rather big issue for us. We&#8217;re commercial company making software for other (mostly) commercial companies. Budget is always an issue. Fortunately this is where automation and a bit of templating can come in quite handy!</p>
<p>It&#8217;s still early, but you can find a sneak peak of what we&#8217;re doing with ASVS at our GitHub repo: <a href="https://github.com/ibuildingsnl/owasp-asvs-report-generator#ibuildings-owasp-asvs-report-generator">ibuildingsnl/ibuildings-owasp-asvs-report-generator</a> (warning, still very alpha).<br />
More on that later!</p>
<p>As for the third issue, <a href="http://lists.owasp.org/pipermail/owasp-application-security-verification-standard/2013-February/000395.html">ASVS 2.0 is in progress and looking for volunteers</a>!</p>
<h2>Tl;dr</h2>
<p>Security is hard. We&#8217;re constantly improving, we already:</p>
<ol>
<li><span style="line-height: 13px;">Give security workshops</span></li>
<li>Do code reviews</li>
<li>Have a senior engineer spend R&amp;D time</li>
</ol>
<p>And now we&#8217;ve added OWASPs ASVS, which is pretty cool, <a title="OWASP ASVS" href="https://www.google.nl/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CC4QFjAA&amp;url=https%3A%2F%2Fwww.owasp.org%2Findex.php%2FCategory%3AOWASP_Application_Security_Verification_Standard_Project&amp;ei=rodLUcuwLeXS0QXJ7YHAAg&amp;usg=AFQjCNE9ycm9geRYp2Zb83RHB71_PZRv6g&amp;bvm=bv.44158598,d.d2k">check it out</a>!</p>
<p>Let us know how you&#8217;ve embedded Software Security in your Software Development LifeCycle in the comments below or on the <a href="https://groups.google.com/forum/#!topic/sectg/gQzBmYhazcA">PHP Security Technical Group</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2013/03/verifying-software-with-owasp-asvs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boosting mobile deployment with PhoneGap Build</title>
		<link>http://ibuildings.nl/blog/2013/02/boosting-mobile-deployment-with-phonegap-build/</link>
		<comments>http://ibuildings.nl/blog/2013/02/boosting-mobile-deployment-with-phonegap-build/#comments</comments>
		<pubDate>Fri, 08 Feb 2013 10:40:28 +0000</pubDate>
		<dc:creator>Martin de Keijzer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Cordova]]></category>
		<category><![CDATA[Nitobi]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[PhoneGap Build]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4240</guid>
		<description><![CDATA[Developing a mobile web-based application is one thing, but deploying it is something different altogether. If you’re just deploying to the web, this can be a fairly easy task. The pain usually starts when you want to deploy to multiple OS&#8217;s as a native application. PhoneGap to the rescue In July 2011 Nitobi (now acquired [...]]]></description>
			<content:encoded><![CDATA[<p>Developing a mobile web-based application is one thing, but deploying it is something different altogether. If you’re just deploying to the web, this can be a fairly easy task. The pain usually starts when you want to deploy to multiple OS&#8217;s as a native application.<br />
<span id="more-4240"></span></p>
<h2>PhoneGap to the rescue</h2>
<p>In July 2011 Nitobi (now acquired by Adobe) released a stable version of a small library called <em>PhoneGap</em>. It&#8217;s main purpose was to close the gap between web- and native applications. This was achieved by wrapping web applications in a native app for each supported platform. Another feature to close the gap is to expose Javascript API&#8217;s for functionality which is otherwise only available to native applications.</p>
<p style="text-align: center;"><img class="size-medium wp-image-4259 aligncenter" alt="phonegap" src="http://blog.ibuildings.com/wp-content/uploads/2013/01/phonegap-300x93.png" width="300" height="93" /></p>
<p>From this day on PhoneGap gained more and more enthousiasm from developers around the world, and boosted the development of mobile browsers as people started to make use of the features HTML 5, CSS and Javascript have to offer. At the time of writing PhoneGap 2.3 has been released, and the basic PhoneGap implementation is an incubator project at the Apache Foundation with the name Cordova.</p>
<p style="text-align: center;"><img class="size-medium wp-image-4256 aligncenter" alt="cordova_logo_normal_dark" src="http://blog.ibuildings.com/wp-content/uploads/2013/01/cordova_logo_normal_dark-300x89.png" width="300" height="89" /></p>
<p>For people who are confused with the names; PhoneGap is Adobe&#8217;s implementation, Cordova is the Apache Foundation implementation. At this time it actually doesn&#8217;t matter what is being used. Both implementations are still in sync with eachother. In the future Adobe might decide to create commercial additions or additions which are based on their other products.</p>
<h2>The pain of deploying with PhoneGap</h2>
<p>Even though PhoneGap solves the problem of developing for multiple platforms, the deployment itself is still a painful process. You&#8217;d have to install the native SDK&#8217;s, tools and create a project for each platform in which you add the PhoneGap framework and your web-application. Next to that you&#8217;d have to invest time to investigate and stay up-to-date with the deployment requirements for each platform. This makes the deployment of these applications a tedious task that might even take weeks to get your application out there for all the supported platforms.</p>
<h2>Adobe to the rescue</h2>
<p>Adobe has seen the pain that developers and app publishers have with this way of deploying and they came up with a solution for this; a build farm in the cloud. They named it PhoneGap Build and after an extensive beta-period it is now a stable platform, ready for anyone to use. PhoneGap Build can be linked to your Github account or you can use an AdobeID to login to the service. One of the benefits of linking your Github account is that you can build your public projects (open source) for free! The free plan also includes 1 private project. So you can start test-driving PhoneGap Build without paying a single dollar. If you&#8217;re satisfied and like to add more private applications you can update your plan.</p>
<p>The main functionality is simple; insert your html/javascript application, let PhoneGap Build do it&#8217;s magic, and get a package for the native platforms which are supported. You can look at it as a conveyor belt in a factory.</p>
<p style="text-align: center;"><img class="size-medium wp-image-4253 aligncenter" alt="phonegap build" src="http://blog.ibuildings.com/wp-content/uploads/2013/01/phonegap-build-300x179.png" width="300" height="179" /></p>
<div style="text-align: center;"><em>Source: <a href="mailto:admin@phonegap.com" rel="cc:attributionURL">Adobe / Yohei Shimomae</a> / <a href="http://creativecommons.org/licenses/by-nc/3.0/" rel="license">CC BY-NC 3.0</a></em></div>
<p>Currently PhoneGap Build has support for iOS, Android, Windows Phone, BlackBerry, WebOS and Bada.</p>
<h2>Getting started with PhoneGap Build</h2>
<p>Once you&#8217;ve setup your Github account or Adobe ID account on the <a title="PhoneGap Build" href="http://build.phonegap.com" target="_blank">PhoneGap Build</a> website you&#8217;ll be able to access your dashboard.</p>
<p>The first things you&#8217;ll want to do is adding your application code. PhoneGap Build will ask you to add a public repository from Github, or a private repository/zip file to create a private build project.<br />
Once you&#8217;ve picked your project you can change the name in the next step and add a description to clarify what your app is about. When pressing the &#8220;Ready to build&#8221; button your first build will be initiated, and you can see the results in the bar beneath your project description.</p>
<p style="text-align: center;"><img class="size-full wp-image-4266 aligncenter" alt="firstbuild" src="http://blog.ibuildings.com/wp-content/uploads/2013/01/firstbuild.png" width="566" height="201" /></p>
<p>We see icons having 3 colors, this quickly identifies the state of your builds:</p>
<ul>
<li><strong>Grey:</strong> Your build is not finished yet, the page will be automatically updated when a build is finished.</li>
<li><strong>Blue:</strong> Your build has succeeded, you can download the native package</li>
<li><strong>Red:</strong> An error occurred, further action and a new build is required</li>
</ul>
<p>The grey icons can be ignored for the time being, they will finish up at some point in time which usually translates to just a few minutes. The red&#8217;s are more of a concern, once we click the red icon we will see the detailed view of the project where we can inspect further.</p>
<p><img class="aligncenter size-full wp-image-4325" alt="buildresults" src="http://blog.ibuildings.com/wp-content/uploads/2013/01/buildresults1-e1362732528489.png" width="650" height="177" /></p>
<p>This is where PhoneGap Build really shines, it shows you exactly why your build has failed and provides you with a link on how to possibly resolve the issue. From here on you can work your way through the errors, up to the moment where the builds for your applicable platforms are all blue.</p>
<p>From within the detail view you can fine-tune the metadata settings for your project (like the project icon, package name, package version etc) or add collaborators if you&#8217;re working on an app with a team, this is all pretty straight forward.</p>
<h2>Distributing the build</h2>
<p>Once you&#8217;ve set up your project and all applicable keys are in place, you can start distributing your app. There are 2 types of distribution which need to be taken into account; <em>development</em> distributions and <em>public</em> distributions.</p>
<p>The development distributions can be used to test your applications on physical devices, or to showcase the state of the product to your customer. To setup the devices you&#8217;ll need to setup the proper keys and settings as you would when building a native application. There is no silver bullet to circumvent these rules created by the platform manufacturers. Once you&#8217;ve setup the proper keys or device settings you can open the PhoneGap build dashboard and scan the QR-code with your favorite scanner on your testing device. The application installer will now launch and place the application on your device. No cable connections or desktop applications are required, which makes it super easy to load your test build.</p>
<p style="text-align: center;"><img class="size-full wp-image-4309 aligncenter" alt="pgbuild-qr" src="http://blog.ibuildings.com/wp-content/uploads/2013/01/pgbuild-qr.png" width="133" height="198" /></p>
<p>Next to that there is also a link you can share to testers, or you can visit the PhoneGap build dashboard with your phone, which uses a responsive design, and use the install-button from there. This easy to use functionality is a huge time saver.</p>
<p>Just click on one of the platforms icons and the package will download to your computer. Unfortunately like with setting up the test devices there is also no silver bullet to send these packages directly to an App Store. Who knows what the future might have in store for us, but up until today this process is still bound to the platform manufacturer&#8217;s system.</p>
<h2>Advancing your build with a config.xml</h2>
<p>Usually when working on a small project the information from the Getting started should be enough. But once you start building larger projects you might want to fine-tune your builds further and add a configuration to your source-code repository.</p>
<p>You can do this by adding a <strong>config.xml</strong> file to your project root directory which conforms to the <a title="W3C Widget specification" href="http://www.w3.org/TR/widgets/" target="_blank">W3C Widget Specification</a>. The PhoneGap team has already created a boilerplate file to get you up and running:</p>
<p>https://gist.github.com/5063962</p>
<p>This sets up the basic project just like you would after reading the getting started. The real magic is happening in this file when you&#8217;re having specific deployment requirements, like &#8220;Do not show the default spinner when loading the app on iOS&#8221; or &#8220;My application is Jelly Bean specific for Android&#8221;.</p>
<p><strong>No iOS splash screen spinner</strong></p>
<p>https://gist.github.com/5064255</p>
<p><strong>Only build for Jelly Bean</strong></p>
<p>https://gist.github.com/5064262</p>
<p>There are many options you can explore, all of these are documented at <a title="PhoneGap Build config.xml" href="http://build.phonegap.com/docs/config-xml" target="_blank">http://build.phonegap.com/docs/config-xml</a></p>
<h2>In conclusion</h2>
<p>PhoneGap is a wonderful way to make your web applications available through app stores and marketplaces, and PhoneGap Build is a great addition to the tool. It helps you not to invest time on repetitive tasks when creating builds, but to actually spend your precious time on development and distribution.</p>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2013/02/boosting-mobile-deployment-with-phonegap-build/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DMCRadio: Sencha Touch 2</title>
		<link>http://ibuildings.nl/blog/2013/01/dmcradio-sencha-touch-2/</link>
		<comments>http://ibuildings.nl/blog/2013/01/dmcradio-sencha-touch-2/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 08:24:37 +0000</pubDate>
		<dc:creator>dpcradio</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Sencha]]></category>
		<category><![CDATA[Tommy Maintz]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4137</guid>
		<description><![CDATA[Episode: 2012 &#8211; 15 Tommy Maintz In this session, Tommy Maintz will guide you through building an HTML5 mobile web application using the latest release of Sencha Touch 2. If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Episode:</strong> 2012 &#8211; 15<br />
<strong>Tommy Maintz </strong></p>
<p>In this session, Tommy Maintz will guide you through building an HTML5 mobile web application using the latest release of Sencha Touch 2.</p>
<p>If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our iTunes podcasts.</p>
<ul>
<li>DPC <a href="https://itunes.apple.com/nl/podcast/dpc-radio/id568825964" title="DPC Sessions" target="_blank">podcast</a></li>
<li>DMC <a href="https://itunes.apple.com/nl/podcast/dmc-radio/id568826377" title="DMC Sessions" target="_blank">podcast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2013/01/dmcradio-sencha-touch-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dpcradio.s3.amazonaws.com/dmc_2012_15.mp3" length="112093655" type="audio/mpeg" />
		</item>
		<item>
		<title>DPCRadio:Scalability issues: cure first, prevent later</title>
		<link>http://ibuildings.nl/blog/2013/01/dpcradioscalability-issues-cure-first-prevent-later/</link>
		<comments>http://ibuildings.nl/blog/2013/01/dpcradioscalability-issues-cure-first-prevent-later/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 08:24:11 +0000</pubDate>
		<dc:creator>dpcradio</dc:creator>
				<category><![CDATA[DPCRadio]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[Thijs Feryn]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4076</guid>
		<description><![CDATA[Episode: 2012 &#8211; 26 Thijs Feryn The &#8220;it works on my machine&#8221; mentality has resulted in numerous face palm moments. This is even more painful when a your app is under heavy load due to a marketing campaign. With some minimal code changes and some smart utilities, you can maximize your scalability and performance. Keywords: [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Episode:</strong> 2012 &#8211; 26<br />
<strong>Thijs Feryn</strong></p>
<p>The &#8220;it works on my machine&#8221; mentality has resulted in numerous face palm moments. This is even more painful when a your app is under heavy load due to a marketing campaign.</p>
<p>With some minimal code changes and some smart utilities, you can maximize your scalability and performance. Keywords: Varnish, PHP-FPM, Nginx, APC, CDN, Gearman, Memcached and a proper server setup.</p>
<p>I&#8217;ll show you how you can make a slow app with a crappy code base go mighty fast on one and even multiple servers. The focus of this talk is to cure first and eventually learn and prevent.</p>
<p>If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our iTunes podcasts.</p>
<ul>
<li>DPC <a href="https://itunes.apple.com/nl/podcast/dpc-radio/id568825964" title="DPC Sessions" target="_blank">podcast</a></li>
<li>DMC <a href="https://itunes.apple.com/nl/podcast/dmc-radio/id568826377" title="DMC Sessions" target="_blank">podcast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2013/01/dpcradioscalability-issues-cure-first-prevent-later/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dpcradio.s3.amazonaws.com/2012_026.mp3" length="133387662" type="audio/mpeg" />
		</item>
		<item>
		<title>DMCRadio: Ten considerations for taking a web business to the mobile market</title>
		<link>http://ibuildings.nl/blog/2013/01/dmcradio-ten-considerations-for-taking-a-web-business-to-the-mobile-market/</link>
		<comments>http://ibuildings.nl/blog/2013/01/dmcradio-ten-considerations-for-taking-a-web-business-to-the-mobile-market/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 08:23:52 +0000</pubDate>
		<dc:creator>dpcradio</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mobile web]]></category>
		<category><![CDATA[Sam de Freyssinet]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4126</guid>
		<description><![CDATA[Episode: 2012 &#8211; 10 Sam de Freyssinet Business owners have woken up to the reality that the web is increasingly consumed on the move. Product owners are demanding new mobile sites that must be released yesterday! You manage an established online business, now you need to move into the mobile market. How do you take [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Episode:</strong> 2012 &#8211; 10<br />
<strong>Sam de Freyssinet </strong></p>
<p>Business owners have woken up to the reality that the web is increasingly consumed on the move. Product owners are demanding new mobile sites that must be released yesterday! You manage an established online business, now you need to move into the mobile market. How do you take your existing business into a mobile domain? Does the entirety of your current business model need to exist in the mobile environment? Or is there a killer mobile app hidden within your existing product? This talk will walk through ten considerations that you must make when moving your online business to a mobile audience. Using a case study from a web startup transitioning to the mobile market, we take a guided tour through the challenges encountered and how you can avoid them in your business.Throughout this session, we will examine the finer points of the mobile development process we wished we had considered in advance. Learn how the user experience evolved beyond the initial business requirements through prototypes and testing. Discover how the legacy architecture was not suitable for mobile operations and the big infrastructure decisions that resulted. Witness our decision making process that led to the final solutions.Laid bare in this talk is the entire mobile development process as we experienced it, distilled down to ten useful pointers for you to take away.</p>
<p>If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our iTunes podcasts.</p>
<ul>
<li>DPC <a href="https://itunes.apple.com/nl/podcast/dpc-radio/id568825964" title="DPC Sessions" target="_blank">podcast</a></li>
<li>DMC <a href="https://itunes.apple.com/nl/podcast/dmc-radio/id568826377" title="DMC Sessions" target="_blank">podcast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2013/01/dmcradio-ten-considerations-for-taking-a-web-business-to-the-mobile-market/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dpcradio.s3.amazonaws.com/dmc_2012_10.mp3" length="110560846" type="audio/mpeg" />
		</item>
		<item>
		<title>DPCRadio: The API Dilemma</title>
		<link>http://ibuildings.nl/blog/2013/01/dpcradio-the-api-dilemma/</link>
		<comments>http://ibuildings.nl/blog/2013/01/dpcradio-the-api-dilemma/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 08:23:25 +0000</pubDate>
		<dc:creator>dpcradio</dc:creator>
				<category><![CDATA[DPCRadio]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chris cornutt]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4097</guid>
		<description><![CDATA[Episode: 2012 &#8211; 30 Chris Cornutt Creating a good, useful and functional API for your application can be one of the most difficult parts of a project. With more and more things becoming API-powered, it&#8217;s important to plan well and provide what the user expects. I&#8217;ll look at some principles you can follow to make [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Episode:</strong> 2012 &#8211; 30<br />
<strong>Chris Cornutt</strong></p>
<p>Creating a good, useful and functional API for your application can be one of the most difficult parts of a project. With more and more things becoming API-powered, it&#8217;s important to plan well and provide what the user expects. I&#8217;ll look at some principles you can follow to make sure the API you write is the right one, both from the developer perspective and what you, as a user, should expect of a quality web service API.</p>
<p>If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our iTunes podcasts.</p>
<ul>
<li>DPC <a href="https://itunes.apple.com/nl/podcast/dpc-radio/id568825964" title="DPC Sessions" target="_blank">podcast</a></li>
<li>DMC <a href="https://itunes.apple.com/nl/podcast/dmc-radio/id568826377" title="DMC Sessions" target="_blank">podcast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2013/01/dpcradio-the-api-dilemma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dpcradio.s3.amazonaws.com/2012_030.mp3" length="120080858" type="audio/mpeg" />
		</item>
		<item>
		<title>DMCRadio: CocoonJS</title>
		<link>http://ibuildings.nl/blog/2012/11/dmcradio-cocoonjs/</link>
		<comments>http://ibuildings.nl/blog/2012/11/dmcradio-cocoonjs/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 09:12:33 +0000</pubDate>
		<dc:creator>dpcradio</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ibon Tolosana]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4130</guid>
		<description><![CDATA[Episode: 2012 &#8211; 12 Ibon Tolosana CocoonJS is a native wrapper for HTML5 canvas based applications/games.Without any code changes and thanks to its OpenGL canvas bindings CocoonJS is able to execute you applications with almost a 1000% performance boost.CocoonJS offers native iOS and Android deployment environment. It is highly focused on monetization since applications deployed [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Episode:</strong> 2012 &#8211; 12<br />
<strong>Ibon Tolosana</strong></p>
<p>CocoonJS is a native wrapper for HTML5 canvas based applications/games.Without any code changes and thanks to its OpenGL canvas bindings CocoonJS is able to execute you applications with almost a 1000% performance boost.CocoonJS offers native iOS and Android deployment environment.  It is highly focused on monetization since applications deployed in CocoonJS have out-of-the-box Ad networks and tracking systems integration. Other features like asynchronous websockets, localStorage, facebook integration, etc. are available too. All this magic is achieved directly, without cross-compilation processes or being limited to custom APIs.</p>
<p>If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our iTunes podcasts.</p>
<ul>
<li>DPC <a href="https://itunes.apple.com/nl/podcast/dpc-radio/id568825964" title="DPC Sessions" target="_blank">podcast</a></li>
<li>DMC <a href="https://itunes.apple.com/nl/podcast/dmc-radio/id568826377" title="DMC Sessions" target="_blank">podcast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2012/11/dmcradio-cocoonjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dpcradio.s3.amazonaws.com/dmc_2012_12.mp3" length="95253031" type="audio/mpeg" />
		</item>
		<item>
		<title>DPCRadio: Travis CI – Distributed CI for the masses!</title>
		<link>http://ibuildings.nl/blog/2012/11/dpcradio-travis-ci-distributed-ci-for-the-masses/</link>
		<comments>http://ibuildings.nl/blog/2012/11/dpcradio-travis-ci-distributed-ci-for-the-masses/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 09:12:29 +0000</pubDate>
		<dc:creator>dpcradio</dc:creator>
				<category><![CDATA[DPCRadio]]></category>
		<category><![CDATA[Josh Kalderimis]]></category>
		<category><![CDATA[travis ci]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4020</guid>
		<description><![CDATA[Episode: 2012 &#8211; 16 Josh Kalderimis Continuous Integration has typically been a practice only performed by companies who want that piece of mind for their client software, but does it need to be like this? Travis CI is a continuous integration service for the open source community. We make testing OS projects dead simple and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Episode:</strong> 2012 &#8211; 16<br />
<strong>Josh Kalderimis</strong></p>
<p>Continuous Integration has typically been a practice only performed by companies who want that piece of mind for their client software, but does it need to be like this?</p>
<p>Travis CI is a continuous integration service for the open source community. We make testing OS projects dead simple and fun. But most importantly, we help improve code quality for large projects like Doctrine2 and symfony, to smaller libraries like FOSRest.</p>
<p>The vision behind Travis CI is to become for builds what PEAR is for distributing libraries.</p>
<p>In this talk Josh, one of the core members of the Travis CI team, will introduce you to the vision behind Travis, the how it is implemented, and why it matters to everyone in the OS community.</p>
<p>If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our iTunes podcasts.</p>
<ul>
<li>DPC <a href="https://itunes.apple.com/nl/podcast/dpc-radio/id568825964" title="DPC Sessions" target="_blank">podcast</a></li>
<li>DMC <a href="https://itunes.apple.com/nl/podcast/dmc-radio/id568826377" title="DMC Sessions" target="_blank">podcast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2012/11/dpcradio-travis-ci-distributed-ci-for-the-masses/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://dpcradio.s3.amazonaws.com/2012_016.mp3" length="110037329" type="audio/mpeg" />
		</item>
		<item>
		<title>Getting started with Sencha Touch 2</title>
		<link>http://ibuildings.nl/blog/2012/11/getting-started-with-sencha-touch-2/</link>
		<comments>http://ibuildings.nl/blog/2012/11/getting-started-with-sencha-touch-2/#comments</comments>
		<pubDate>Tue, 13 Nov 2012 13:09:42 +0000</pubDate>
		<dc:creator>Martin de Keijzer</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Sencha Touch 2]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4192</guid>
		<description><![CDATA[The web as a mobile platform The web has been a great place on desktops and laptops for quite some time, but with a booming growth of mobile devices like tablets and smartphones, the internet has become increasingly more interesting on these devices as well. Building mobile apps for the web has some advantages when [...]]]></description>
			<content:encoded><![CDATA[<style>
  table.confluenceTable {
    margin: 0 auto 23px; 
  }
  .table-wrap td {
    border: 1px solid black;
    padding: 3px;
  }
  h2 {
    padding: 10px 0 10px 0;
  }
  p {
    padding: 10px 0 10px 0;
  }
</style>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-Thewebasamobileplatform"></a>The web as a mobile platform</h2>
<p>The web has been a great place on desktops and laptops for quite some time, but with a booming growth of mobile devices like tablets and smartphones, the internet has become increasingly more interesting on these devices as well. Building mobile apps for the web has some advantages when compared to native development, before we start with Sencha Touch 2 we will take a look at these advantages.</p>
<p><span id="more-4192"></span></p>
<p>If we look at 3 popular platforms there are a few distinctions which we need to keep in mind if we want to develop native applications for them:</p>
<div class="table-wrap">
<table class="confluenceTable">
<tbody>
<tr>
<td class="confluenceTd"> <font color="#000000"><b>Platform</b></font> </td>
<td class="confluenceTd"> <font color="#000000"><b>Main programming language</b></font> </td>
<td class="confluenceTd"> <font color="#000000"><b>Distribution method</b></font> </td>
</tr>
<tr>
<td class="confluenceTd"> <font color="#000000">Apple iOS</font> </td>
<td class="confluenceTd"> <font color="#000000">Objective-C</font> </td>
<td class="confluenceTd"> <font color="#000000">Apple App Store</font> </td>
</tr>
<tr>
<td class="confluenceTd"> <font color="#000000">Android</font> </td>
<td class="confluenceTd"> <font color="#000000">Java</font> </td>
<td class="confluenceTd"> <font color="#000000">Google Play, Amazon, etc</font> </td>
</tr>
<tr>
<td class="confluenceTd"> <font color="#000000">Windows Phone</font> </td>
<td class="confluenceTd"> <font color="#000000">C# / Visual Basic</font> </td>
<td class="confluenceTd"> <font color="#000000">Microsoft Market</font> </td>
</tr>
</tbody>
</table>
</div>
<p>As you can see in the table above there are a lot of dependencies which require a lot of different knowledge which makes it expensive and bug-sensitive to create the same application for all the platforms. Web applications have multiple advantages to overcome these issues:</p>
<ul>
<li>Available through the web, so no app store submissions and reviews are required. This also makes your app immediately available when you require it.</li>
<li>Platform independent, the app can be used on any platform you want to support. In the end it all boils down to supporting browsers.</li>
<li>You have complete freedom over the user interface. If you want to create an app-like experience you can mimic the UI elements you like best from the native world or you can create your own unique branding.</li>
<li>Webapps can still be wrapped as native apps to push to the different app stores, options for doing this include <a href="http://www.sencha.com/blog/all-new-sencha-cmd/" class="external-link" rel="nofollow">Sencha Cmd</a> and <a href="http://www.phonegap.com" class="external-link" rel="nofollow">Adobe’s Phonegap</a> (or the open source base implementation called <a href="http://incubator.apache.org/cordova/" class="external-link" rel="nofollow">Apache Cordova</a>).</li>
</ul>
<p>To achieve the goals mentioned above here you can make use of many web application frameworks, in this post we will focus on one of these; <a href="http://www.sencha.com/products/touch/" class="external-link" rel="nofollow">Sencha Touch 2</a>. It has some advantages that make it a very strong framework for many business cases:</p>
<ul>
<li>Very strong at building applications instead of shiny websites</li>
<li>All business logic is implemented using pure Javascript</li>
<li>It is a touch-enabled framework, which makes it a premium choice for touch-enabled devices</li>
<li>It has an (S)MVC pattern to have a good separation of concerns</li>
<li>It is based on the well known ExtJS 4 framework</li>
<li>Excellent <a href="http://docs.sencha.com/touch/2-0/" class="external-link" rel="nofollow">documentation</a></li>
</ul>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-GettingstartedwiththeSenchaSDKTools"></a>Getting started with the Sencha SDK Tools</h2>
<p><em>This article is based on Sencha Touch 2.1.0 RC2 and Sencha Cmd v3 beta</em></p>
<p><a href="http://blog.ibuildings.com/?attachment_id=4207" rel="attachment wp-att-4207"><img src="http://blog.ibuildings.com/wp-content/uploads/2012/11/sencha_logo-300x125.png" alt="" title="sencha_logo" width="300" height="125" class="alignnone size-medium wp-image-4207" /></a></p>
<p>Sencha offers a great command line tool to get you up to speed very quickly, once you have <a href="http://www.sencha.com/products/touch/download/" class="external-link" rel="nofollow">downloaded</a> and installed Sencha Cmd and the Sencha Touch 2 framework you can go to the framework’s folder and run the following command:</p>
<div class="preformatted panel" style="border-width: 1px;">
<div class="preformattedContent panelContent">

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sencha generate app MyAwesomeApp ~<span style="color: #000000; font-weight: bold;">/</span>MyAwesomeApp</pre></div></div>

</div>
</div>
<p>This will generate a new application for you with the namespace MyAwesomeApp in your home-folder. To view the generated app, you can use any Webkit based browser to open the generated index.html in your <em>~/MyAwesomeApp</em> folder.</p>
<p>If we open up a file browser to investigate what has been generated we see a whole lot of files and folders, let’s dissect these and see what they do:</p>
<ul>
<li><b>[directory]</b> <b>app</b>: This is where the code of your application lives, it contains the views, data packages, profiles and controllers. In the rest of the article we will have a more thorough drill down of these folders.</li>
<li><b>[directory] resources</b>: Here we will see static resources like the styling, images, splashscreens and icons for our app.</li>
<li><b>[file] app.js</b>: The app.js file is the main bootstrap for your application, it determines the app name, icons, required classes and initiates the launch.</li>
<li><b>[file] *.json</b>: In the main folder there are 2 JSON files, these are used for building the app. Once your app is ready to go live you can review these files or extend them to get everything you require in the distributable package.</li>
<li><b>[file] index.html</b>: The main index file, it shows the preloader and initiates the app.js</li>
<li><b>[directory] touch</b>: This directory contains the Sencha Touch SDK, <em>do not touch this directory</em>, whenever you want to upgrade the SDK of your project this directory will be overwritten and changes will get lost. If you want to customize SDK components it’s better to add in your own library directory and extend the objects from the SDK.</li>
</ul>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-Creatingauserinterface"></a>Creating a user interface</h2>
<p>To make your app functional you will need to interact with your user, Sencha Touch 2 comes packed with many user interface components. These include:</p>
<ul>
<li>Containers</li>
<li>Panels</li>
<li>Tab Panels</li>
<li>Carousels</li>
<li>Lists</li>
<li>Forms</li>
<li>Toolbars</li>
</ul>
<p>These components are all highly configurable which makes them very powerful to quickly create a functional UI.</p>
<p>To get started with an example we will create a file in the <em>app/view/</em> directory of our application, and we will call it <em>Pictures.js</em><br />
This view will be a picture gallery shown as a gallery which people can interact with by swiping the images. We have placed several images in the <em>resources/images/</em> directory which we are going to use as the content for our gallery.</p>
<p>The content of this file will be as following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">define</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MyAwesomeApp.view.Pictures'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
   extend<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Ext.carousel.Carousel'</span><span style="color: #339933;">,</span>
   xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'employeescarousel'</span><span style="color: #339933;">,</span>
&nbsp;
   config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
       items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
           <span style="color: #009900;">&#123;</span> html<span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;img src=&quot;resources/images/1.png&quot;&gt;'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
           <span style="color: #009900;">&#123;</span> html<span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;img src=&quot;resources/images/2.png&quot;&gt;'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
           <span style="color: #009900;">&#123;</span> html<span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;img src=&quot;resources/images/3.png&quot;&gt;'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
           <span style="color: #009900;">&#123;</span> html<span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;img src=&quot;resources/images/4.png&quot;&gt;'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
           <span style="color: #009900;">&#123;</span> html<span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;img src=&quot;resources/images/5.png&quot;&gt;'</span> <span style="color: #009900;">&#125;</span>
       <span style="color: #009900;">&#93;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If we break down this code we see just 1 method call; <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext-method-define" class="external-link" rel="nofollow">Ext.define</a>. This method creates a new class in the Sencha class system. The first argument is the name we want to give to our class, this name starts with MyAwesomeApp.view so the autoloader will detect it as an application class which is stored in the view directory. The last part of the class name is the actual name of the class which maps to your .js file. The second argument is an object which defines our class.</p>
<p>Since we want to use the carousel component to swipe through our content we extend the <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.carousel.Carousel" class="external-link" rel="nofollow">Ext.carousel.Carousel</a> class and give it an xtype. The xtype defines the unique name for the component, keep in mind though that one components can have multiple instances so it is not comparable to the id-attribute of an HTML element.</p>
<p>Finally we add the configuration for our own carousel by defining the items in this carousel as an array of objects. By default a new item will be defined as a Panel-component. For our panel components we define it’s content by feeding it plain HTML code.</p>
<p>Now that we have defined our view we need to make our app aware that this view will be needed for the application. To achieve this we open the <em>app.js</em> in our root folder there we will find a key named views which is an array of strings, at the moment it only contains the generated ‘Main’ we modify the specification by adding our ‘Pictures’ view in it like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">   views<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
       <span style="color: #3366CC;">'Main'</span><span style="color: #339933;">,</span>
       <span style="color: #3366CC;">'Pictures'</span>
   <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span></pre></div></div>

<p>The final step to make the defined and initiated view available to our user is attaching it to one of the available components. If you have already taken a look at the generated application you will see that it contains a <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.tab.Panel" class="external-link" rel="nofollow">tab panel</a>, to make our picture gallery available to our users we are going to add a new tab on this bar which will show the picture gallery view. For this we open the <em>app/view/Main.js</em> file and edit the configuration of the tab panel with a new item:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">define</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MyAwesomeApp.view.Main'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
   extend<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Ext.tab.Panel'</span><span style="color: #339933;">,</span>
   xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'main'</span><span style="color: #339933;">,</span>
   requires<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
       <span style="color: #3366CC;">'Ext.TitleBar'</span><span style="color: #339933;">,</span>
       <span style="color: #3366CC;">'Ext.Video'</span>
   <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
   config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
       tabBarPosition<span style="color: #339933;">:</span> <span style="color: #3366CC;">'bottom'</span><span style="color: #339933;">,</span>
&nbsp;
       items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
           <span style="color: #009900;">&#123;</span> title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Welcome'</span>...<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
           <span style="color: #009900;">&#123;</span> title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Get Started'</span>...<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
           <span style="color: #009900;">&#123;</span>
               title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Employees'</span><span style="color: #339933;">,</span>
               xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'employeescarousel'</span><span style="color: #339933;">,</span>
               iconCls<span style="color: #339933;">:</span> <span style="color: #3366CC;">'photos1'</span>
           <span style="color: #009900;">&#125;</span>
       <span style="color: #009900;">&#93;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Do not just copy and paste this example, for clarity&#8217;s sake we have shortened the first 2 items of the configuration. Here we configure the title for the new tab, we tell it that the tab contains our newly created xtype employeescarousel and we attach a class for our icon to the tab (creating these icon classes will be explained later on).</p>
<p>Once we open up our app now we will have a new tab with the view we just created.<br />
<a href="http://blog.ibuildings.com/2012/11/13/getting-started-with-sencha-touch-2/screen-shot-2012-10-19-at-14-48-37/" rel="attachment wp-att-4209"><img src="http://blog.ibuildings.com/wp-content/uploads/2012/11/Screen-Shot-2012-10-19-at-14.48.37-232x300.png" alt="" title="Screen Shot 2012-10-19 at 14.48.37" width="232" height="300" class="alignnone size-medium wp-image-4209" /></a><br />
<b>Congratulations, you have just created your first mobile web app!</b> But of course we can do a lot more, let’s dive into the deep.</p>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-Takingcontrol"></a>Taking control</h2>
<p>As developers we like to have control over what is happening. Sencha Touch 2 offers various places to do this, but to keep your code clean, the best options are the bootstrap and the controllers.</p>
<p>Bootstrapping is a way to run code while the application is still booting and not yet used by our user. The bootstrap in Sencha Touch 2 is defined as a method called launch in your controllers. The generated app already contains a bootstrap in the <em>app.js</em> in the root folder. It is good to keep in mind that classes defined as controllers and profiles can also contain a launch method which are being run as bootstrap, the bootstrap in these files get executed before the one defined in your main app file.</p>
<p>Let’s see what will happen if we ad a simple alert box to our application once it gets booted by modifying the launch method of the <em>app.js</em> in our root folder:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    launch<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>
       <span style="color: #006600; font-style: italic;">// Destroy the #appLoadingIndicator element</span>
       Ext.<span style="color: #660066;">fly</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'appLoadingIndicator'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">destroy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
       <span style="color: #006600; font-style: italic;">// Initialize the main view</span>
       Ext.<span style="color: #660066;">Viewport</span>.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MyAwesomeApp.view.Main'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
       <span style="color: #006600; font-style: italic;">// Taking control in our bootstrap</span>
       Ext.<span style="color: #660066;">Msg</span>.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Welcome'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Welcome to my first awesome app!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>

<p>In our example we have added the <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.MessageBox-method-alert" class="external-link" rel="nofollow">Ext.Msg.Alert</a> which takes a title and a message as it’s arguments. When we reload our app in the browser we get an alert message component which shows this text. So as we can see, we can already take control before the user has done any interaction with our application.</p>
<p>Most of the times we will also want to take control of the events like  user interactions with the app (e.g. tapping a component). In our example we are going to change the code for our html panels in <em>/app/view/Pictures.js</em> into a more specific type of component so we can interact with it in an easy way in the next steps:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #009900;">&#123;</span>
        xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'img'</span><span style="color: #339933;">,</span>
        src<span style="color: #339933;">:</span> <span style="color: #3366CC;">'resources/images/1.png'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>

<p>The next step is to open a terminal and go to the directory where we generated our app, in our example this is <em>~/MyAwesomeApp</em> and we run the following command:</p>
<p>sencha generate controller PictureTab</p>
<p>This creates a new controller skeleton which can, as the name implies, control various events. It also adds a reference for this controller to the <em>app.js</em>. As we open up the controller file in <em>app/controller/PictureTab.js</em> we can see the predefined <em>config</em> key. The config consists of 2 properties:</p>
<ul>
<li>refs: attaches a key to all components that match the <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.ComponentQuery" class="external-link" rel="nofollow">ComponentQuery</a> defined for it. A ComponentQuery is a simple query-type within Sencha Touch to select components rather than HTML elements.</li>
<li>control: specifies the events and attached actions for these events.</li>
</ul>
<p>Let’s have a look how we can make the application trigger an event once we tap one of the pictures.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">   config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
       refs<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
           picture<span style="color: #339933;">:</span> <span style="color: #3366CC;">'img'</span>
       <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
       control<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #3366CC;">'picture'</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
               <span style="color: #3366CC;">'tap'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'onPictureTap'</span>
           <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span></pre></div></div>

<p>In the refs we have placed the line picture: &#8216;img&#8217; this defined that every img xtype in our views is referred to as picture in our controller.</p>
<p>In the control section we make use of this reference and attach an object with the property &#8216;tap&#8217;: &#8216;onPictureTap&#8217; this tells the application that we want to take control once an image is tapped. The definition of this control will be placed in the onPictureTap method inside the controller. This brings us to the final step which is implementing the definition. In our controller object definition we add the onPictureTap method. As an example we will show an alert box to the user, which tells the user what the location of this image is. If you’re not bootstrapping anything this is also a good opportunity to remove the launch method.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">   onPictureTap<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>imageComponent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #003366; font-weight: bold;">var</span> src <span style="color: #339933;">=</span> imageComponent.<span style="color: #660066;">getSrc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       Ext.<span style="color: #660066;">Msg</span>.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Event handled'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'You tapped '</span> <span style="color: #339933;">+</span> src<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Note that the first argument of this function is the component instance which triggered the event. This way we can use the component’s methods to access it.</p>
<p><a href="http://blog.ibuildings.com/2012/11/13/getting-started-with-sencha-touch-2/screen-shot-2012-10-19-at-14-50-44/" rel="attachment wp-att-4211"><img src="http://blog.ibuildings.com/wp-content/uploads/2012/11/Screen-Shot-2012-10-19-at-14.50.44-232x300.png" alt="" title="Screen Shot 2012-10-19 at 14.50.44" width="232" height="300" class="alignnone size-medium wp-image-4211" /></a></p>
<p>Once we reload the app in our browser and tap a picture in the carousel we should see a message with the name of the image in it.</p>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-Databinding"></a>Data binding</h2>
<p>Now we know how to control the applications our next concern is working with data. Sencha Touch 2 provides a very complete data handling package which we will utilize in this chapter.</p>
<p><a href="http://blog.ibuildings.com/?attachment_id=4213" rel="attachment wp-att-4213"><img src="http://blog.ibuildings.com/wp-content/uploads/2012/11/data-package.png" alt="" title="data-package" width="669" height="550" class="alignnone size-full wp-image-4213" /></a></p>
<p>In the image above we can see the main components included in the data package. The Model is a single entity of a ‘thing’ in your application (like a product, user or calendar item), it defines the blueprint of this entity. A Store is a collection of entities commonly used to propagate a list. The Proxy defines the read and write gateways to the data source which holds the data.</p>
<h3><a name="Tutorial-CreatingyourfirstSenchaTouch2application-"></a><font color="#666666">Model</font></h3>
<p>If we want to start adding data to our application we will need to define the blueprint of our <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Model" class="external-link" rel="nofollow">model</a> first. The model will have certain properties with a data type attached to it (if no datatype is defined Sencha Touch 2 will automatically assign one, this is not advised as this can lead to unexpected results). Let’s define a blueprint for an employee by running the following command from our application root:</p>
<p>sencha generate model Employee id:int,name:string,imgsrc:string</p>
<p>This will create a new file in <em>app/model/</em> called <em>Employee.js</em> which has the properties we’ve just defined as a key named fields in the object’s config.</p>
<h3><a name="Tutorial-CreatingyourfirstSenchaTouch2application-"></a><font color="#666666">Store</font></h3>
<p>Creating a store is not part of Sencha Cmd, just like views, therefor we need to create a new store manually. This gives us a good opportunity to review how we manually add components to our project.</p>
<p>We start off by creating a file called <em>Employees.js</em> in the <em>app/store/</em> directory. In this file we define the following class:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">define</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MyAwesomeApp.store.Employees'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
   extend<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Ext.data.Store'</span><span style="color: #339933;">,</span>
&nbsp;
   config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
       model<span style="color: #339933;">:</span> <span style="color: #3366CC;">'MyAwesomeApp.model.Employee'</span><span style="color: #339933;">,</span>
       autoLoad<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In this class we extend a basic store (<a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Store" class="external-link" rel="nofollow">Ext.data.Store</a><em>)</em>, which is an abstract implementation. Then we configure the store by telling it that it needs to use the MyAwesomeApp.model.Employee model as the blueprint for it’s data. The second configuration option autoLoad tells the application that the data needs to be loaded upon opening the application.</p>
<p>The final step for defining our store is adding it to our <em>app.js</em> in the root directory of our application. There you add a new property called stores which will define an array of strings with the stores which we are going to use, of course we start off with our Employees store.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">   stores<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
       <span style="color: #3366CC;">'Employees'</span>
   <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span></pre></div></div>

<h3><a name="Tutorial-CreatingyourfirstSenchaTouch2application-"></a><font color="#666666">Proxies</font></h3>
<p>The final addition before we can start pulling data and use it in our application is a <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.data.proxy.Proxy" class="external-link" rel="nofollow">proxy</a>. Proxies can be attached to both stores and models as a config item. The most common case is that the store will know it’s model class and that the model will have the proxy attached. This gives us the power to use a single model with the proxy rather than having to initiate a collection of models.</p>
<p>The proxy will consist of 2 main items which are a <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.data.reader.Reader" class="external-link" rel="nofollow">reader</a> and a <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.data.writer.Writer" class="external-link" rel="nofollow">writer</a>. The scope of this article will just show the reader since they are very similar.<br />
Our proxy will read a static file on the server (<em>resources/employees.json</em>) in our resource folder using AJAX, the following config in our model (<em>app/model/Employee.js</em>) defines this proxy in it’s config:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    proxy<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'ajax'</span><span style="color: #339933;">,</span>
        url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'resources/employees.json'</span><span style="color: #339933;">,</span>
        reader<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
            type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'json'</span><span style="color: #339933;">,</span>
            rootProperty<span style="color: #339933;">:</span> <span style="color: #3366CC;">'employees'</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Sencha Touch 2 comes packed with several proxy-, reader- and writer-types, for this example we are using the proxy type ‘ajax’ and assign the url of the ajax resource which is a JSON file. The next item is a reader which is capable of reading ‘json’ and it inspects the file for a root property named ‘employees’ which will contain an array of (suprise, surprise) employees.</p>
<h3><a name="Tutorial-CreatingyourfirstSenchaTouch2application-"></a><font color="#666666">Publishing data through the UI</font></h3>
<p>Once we have the proxy and json file in place we still need a UI element to show the data.<br />
For this we are going to create a new view which will utilize the list component. We create a new file in <em>/app/view/</em> and call it <em>EmployeeList.js</em> and define our new class in it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">define</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MyAwesomeApp.view.EmployeeList'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
   extend<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Ext.dataview.List'</span><span style="color: #339933;">,</span>
   xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'employeeslist'</span><span style="color: #339933;">,</span>
&nbsp;
   config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
       store<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Employees'</span><span style="color: #339933;">,</span>
       layout<span style="color: #339933;">:</span> <span style="color: #3366CC;">'fit'</span><span style="color: #339933;">,</span>
       styleHtmlContent<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
       itemTpl<span style="color: #339933;">:</span> <span style="color: #3366CC;">'&lt;h3&gt;&lt;img src=&quot;{imgsrc}&quot; style=&quot;max-height: 40px;&quot;&gt;{name}&lt;/h3&gt;'</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The difference we see here between the view we created before and this one is that we extend an other type of component, the <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.List" class="external-link" rel="nofollow">list</a> component, and that this component takes different config parameters. What we configure here is the store which points to our Employees store we just created, and the itemTpl. This itemTpl represents how 1 item in the list is supposed to look, the data from the model is added in by placing the property we want to show within curly braces.</p>
<p>Once we have our new view in place we add it to the <em>app.js</em>’s view-array as we did before and we create another tab in our <em>app/view/Main.js</em></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #009900;">&#123;</span>
        title<span style="color: #339933;">:</span> <span style="color: #3366CC;">'List'</span><span style="color: #339933;">,</span>
        xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'employeeslist'</span><span style="color: #339933;">,</span>
        iconCls<span style="color: #339933;">:</span> <span style="color: #3366CC;">'photos1'</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>As we can see this tab will refer to the xtype of our newly created EmployeesList class.<br />
When you reload the app now you can see a new tab in the tab bar which will open up a list instance with all the data in it.</p>
<p><a href="http://blog.ibuildings.com/2012/11/13/getting-started-with-sencha-touch-2/screen-shot-2012-10-19-at-14-53-50/" rel="attachment wp-att-4216"><img src="http://blog.ibuildings.com/wp-content/uploads/2012/11/Screen-Shot-2012-10-19-at-14.53.50-158x300.png" alt="" title="Screen Shot 2012-10-19 at 14.53.50" width="158" height="300" class="alignnone size-medium wp-image-4216" /></a></p>
<p>If you want to practice with all we’ve learned up to now it would make sense to attach a non-static data source (like a web-service) and create a simple CRUD app.</p>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-Deviceprofiles"></a>Device profiles</h2>
<p>Sometimes you can’t get around implementing different features for different type of devices, the most common example is that tablets usually have a whole lot more screen real estate than smartphones. Luckily Sencha Touch 2 has the ability to implement <a href="http://docs.sencha.com/touch/2-0/#!/api/Ext.app.Profile" class="external-link" rel="nofollow">profiles</a> so we can easily extend on existing classes. A good tip is to work from the smallest form factor to the larger ones you’d like to implement.</p>
<p>To start working with profiles we can use the Sencha SDK Tools again with the following command:<br />
sencha generate profile Tablet</p>
<p>And we do the same for a phone profile:<br />
sencha generate profile Phone</p>
<p>This creates the new classes in the <em>app/profile/</em> directory. The next thing we need to do is specify when a device is a tablet and when a device is a phone. Sencha Touch will look for a method in the profile which is called isActive, this method needs to return a boolean value so the framework knows if the defined profile needs to be used at runtime.</p>
<p>In this example Sencha Cmd detected what we wanted to do and the isActive method is already implemented. If the name of the class isn’t that obvious the isActive method needs to be modified.</p>
<p>Now that our app is aware of the different profiles we can start creating implementations for it. By default the autoloader will append the namespace with the profile name before the actual class name. To clarify this let’s create different views for our list.</p>
<p>We create a new controller in the directory <em>app/controller/tablet</em> called <em>EmployeesList.js</em> and enter the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">define</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MyAwesomeApp.controller.tablet.EmployeesList'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
   extend<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Ext.app.Controller'</span><span style="color: #339933;">,</span>
&nbsp;
   config<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
       refs<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
           list<span style="color: #339933;">:</span> <span style="color: #3366CC;">'list'</span>
       <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
       control<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #3366CC;">'list'</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
               <span style="color: #3366CC;">'itemtap'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'onItemTap'</span>
           <span style="color: #009900;">&#125;</span>
       <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
   onItemTap<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>listItemComponent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       Ext.<span style="color: #660066;">Msg</span>.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>
           <span style="color: #3366CC;">'Tablet info'</span><span style="color: #339933;">,</span>
           <span style="color: #3366CC;">'On a tablet you will get a large info view'</span>
       <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Please take note of the class name which now contains tablet in it’s namespace.</p>
<p>The final step is making the app aware of this new class, this time we do not add it to the main <em>app.js</em> but the <em>Tablet.js</em> in the <em>app/profiles/</em> directory:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">controllers<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'EmployeesList'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span></pre></div></div>

<p>If you open up the application on a tablet device now (or a tablet device emulator/simulator) the<br />
defined event will run.</p>
<p><a href="http://blog.ibuildings.com/2012/11/13/getting-started-with-sencha-touch-2/screen-shot-2012-10-19-at-14-55-43/" rel="attachment wp-att-4218"><img src="http://blog.ibuildings.com/wp-content/uploads/2012/11/Screen-Shot-2012-10-19-at-14.55.43-231x300.png" alt="" title="Screen Shot 2012-10-19 at 14.55.43" width="231" height="300" class="alignnone size-medium wp-image-4218" /></a></p>
<p>When using a phone emulator you can see that nothing happens when you tap a list item. Now would be the time to practice by implementing a controller which handles these events just for phones.</p>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-Themingandstylingyourapplication"></a>Theming and styling your application</h2>
<p>The default css-theme that comes with Sencha Touch 2 has been heavily influenced by iOS. The good part is that it is also highly customizeable as it is built using <a href="http://compass-style.org" class="external-link" rel="nofollow">Compass</a> (an extension to <a href="http://sass-lang.com" class="external-link" rel="nofollow">SASS</a>). You can get the compass compiler running by using the <a href="http://docs.rubygems.org/read/chapter/3" class="external-link" rel="nofollow">gem</a> installer:</p>
<p>gem install compass</p>
<p>How Compass works is outside of the scope of this article, but for brevity we will highlight a few important things;</p>
<ul>
<li>The extension of a compileable file is .scss</li>
<li>With the command compass compile the changes will be compiled to a normal css file which browsers can interpret.</li>
<li>With the command compass watch the files in the current directory will be compiled as soon as changes are saved to them.</li>
</ul>
<p>You may have noticed that in an earlier stage we added an iconCls property but the icon never showed up in your tabbar. This is where we are going to fix that, open the <em>app.scss</em> file under the <em>resources/sass/</em> directory and add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">@</span>include pictos<span style="color: #339933;">-</span>iconmask<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'photos1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This is a built in function of the Sencha Touch 2 framework to add classes with masked icons. Compile the scss file and the icon should be visible now.</p>
<p><a href="http://blog.ibuildings.com/2012/11/13/getting-started-with-sencha-touch-2/screen-shot-2012-10-19-at-14-58-01/" rel="attachment wp-att-4219"><img src="http://blog.ibuildings.com/wp-content/uploads/2012/11/Screen-Shot-2012-10-19-at-14.58.01-155x300.png" alt="" title="Screen Shot 2012-10-19 at 14.58.01" width="155" height="300" class="alignnone size-medium wp-image-4219" /></a></p>
<p>In addition you can also add normal css to this file and it will be compiled into the resulting css file as well.</p>
<h2><a name="Tutorial-CreatingyourfirstSenchaTouch2application-Somefinaltips"></a>Some final tips</h2>
<p>As you can see Sencha Touch 2 is simple to use, yet very powerful to get your requirements done. Once you start creating your own implementations make good use of the very clear documentation at <a href="http://docs.sencha.com" class="external-link" rel="nofollow">http://docs.sencha.com</a>.</p>
<p>Always make use of Sencha Cmd whenever it supports what you are doing, it takes away the human error for various things which are easily forgotten.</p>
<p>If you feel uncomfortable with Javascript you can also get <a href="http://www.sencha.com/products/architect/" class="external-link" rel="nofollow">Sencha Architect 2</a> which is an easy IDE for setting up your apps. Eventually you will be expected to do some Javascript so get a book on the subject in the meantime.</p>
<p>Always stay away from putting methods in your views. Even though it is tempting and sometimes the documentation points out the possibility to do so, it is not going to help you. Once you start bug fixing or revisiting your project it will get hard to understand why certain events are happening as they do. Always use the controllers and bootstrapping to define functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2012/11/getting-started-with-sencha-touch-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DMCRadio: Mobile Performance Considerations</title>
		<link>http://ibuildings.nl/blog/2012/11/dmcradio-mobile-performance-considerations/</link>
		<comments>http://ibuildings.nl/blog/2012/11/dmcradio-mobile-performance-considerations/#comments</comments>
		<pubDate>Mon, 12 Nov 2012 12:46:34 +0000</pubDate>
		<dc:creator>dpcradio</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Estelle Weyl]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.ibuildings.com/?p=4124</guid>
		<description><![CDATA[Episode: 2012 &#8211; 09 Estelle Weyl Mobile browser performance is challenged by bandwidth, battery, and memory constraints. Slow loading and reacting sites create bad user experiences. Sites that drain batteries or crash the browser are infuriating. Porting a web application designed and developed for desktop devices—devices with virtually unlimited memory, and literally unlimited power (they’re [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Episode:</strong> 2012 &#8211; 09<br />
<strong>Estelle Weyl</strong></p>
<p>Mobile browser performance is challenged by bandwidth, battery, and memory constraints. Slow loading and reacting sites create bad user experiences. Sites that drain batteries or crash the browser are infuriating. Porting a web application designed and developed for desktop devices—devices with virtually unlimited memory, and literally unlimited power (they’re plugged in, not running on battery) in many cases just doesn’t work. By understanding mobile limitations and keeping mobile in mind throughout the development process you can create more responsive, faster downloading, less battery consuming applications.In this session we assume you understand general web performance optimization, and instead focus on best practices required to improve performance on mobile devices. Instead of just covering how best to get a site onto a device, you will learn how to make sure it works optimally once it is there. Topics include HTML5, CSS3, images, JavaScript and the DOM.We’ll cover mobile device limitations that often lead to poor user experiences as well as tips and techniques to prevent these trouble spots from arising.</p>
<p>If you want to have access to the full Dutch PHP Conference &#038; Dutch Mobile Conference content before the official releases you can subscribe to our iTunes podcasts.</p>
<ul>
<li>DPC <a href="https://itunes.apple.com/nl/podcast/dpc-radio/id568825964" title="DPC Sessions" target="_blank">podcast</a></li>
<li>DMC <a href="https://itunes.apple.com/nl/podcast/dmc-radio/id568826377" title="DMC Sessions" target="_blank">podcast</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ibuildings.nl/blog/2012/11/dmcradio-mobile-performance-considerations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://dpcradio.s3.amazonaws.com/dmc_2012_09.mp3" length="99188140" type="audio/mpeg" />
		</item>
	</channel>
</rss>
