<?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>Michael Hall &#187; ubuntu</title>
	<atom:link href="http://mhall119.com/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://mhall119.com</link>
	<description>Random thoughts on programming, science and politics</description>
	<lastBuildDate>Wed, 17 Apr 2013 12:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Building an Ubuntu SDK App: rev 8</title>
		<link>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-8/</link>
		<comments>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-8/#comments</comments>
		<pubDate>Wed, 17 Apr 2013 12:00:00 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Upstream]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[building-sdk-app-series]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1704</guid>
		<description><![CDATA[Back again for one more article on developing an Ubuntu SDK app.  This one might be short,  but it covers one of the cooler bits of magic that QML gives you: Transitions.  But first, be sure to read the previous &#8230; <a href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back again for one more article on developing an Ubuntu SDK app.  This one might be short,  but it covers one of the cooler bits of magic that QML gives you: Transitions.  But first, be sure to read the <a href="http://mhall119.com/tag/building-sdk-app-series/" target="_blank">previous articles</a> in this series!</p>
<h2>Transitions</h2>
<p>It used to be that if you wanted to animate parts of your app, you had to setup timers, calculate distances and speeds, program each step along the way, and do it all without killing the user&#8217;s CPU.  Sure it could be done, it was done, but it wasn&#8217;t easy.  QML is different, <a href="http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-transition.html" target="_blank">QML Transitions</a> aren&#8217;t something you have to bolt on yourself, they&#8217;re built in at the foundation.</p>
<p>A Transition is defined as a collection of Animation components that can change different properties in different ways, triggered automatically by a change in a component&#8217;s state or other properties.  All you, the developer, needs to do is tell QML what you want to change, and how.</p>
<h2>ListView Event Transitions</h2>
<p>QML offers a variety of ways to define transitions, depending on what you need.  All <a href="http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-item.html" target="_blank">Items</a> have a <em>transitions</em>  property, which takes a list of Transition instances that will be called whenever the Item&#8217;s <em>state</em> property is changed.  You can also define a Transition for any property change using the &#8220;Behavior on &lt;property&gt; {}&#8221; syntax, which creates a Transition for changes on the named property.</p>
<p>But for me, it was a third item that fit best.  QML&#8217;s <a href="http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-listview.html" target="_blank">ListView</a> component has several properties that take a Transition instance, properties such as <em>add</em> and <em>remove</em>, which correspond to an item being added or removed from the ListView.  These transitions are then applied to the delegate ListItem component when it is being added or removed.  I used these properties to make the items slide in and out of view when changing subreddit, or moving from one page to another.</p>
<pre>    ListView {
        id: articleList
        ...
        add: <strong>Transition</strong> {
            id: addAnimation
            property bool forward: true
            <strong>SequentialAnimation</strong> {
                <strong>NumberAnimation</strong> { properties: "x"; from: addAnimation.forward ? articleList.width : -articleList.width; to: 0; duration: 300 }
            }

        }
        remove: <strong>Transition</strong> {
            id: removeAnimation
            property bool forward: true
            <strong>SequentialAnimation</strong> {
                <strong>NumberAnimation</strong> { properties: "x"; from: 0; to: removeAnimation.forward ? -articleList.width : articleList.width; duration: 300 }
            }
        }
    }</pre>
<p>At first I just had transitions going in one direction, but I wanted to give some implicit meaning to them, going one direction for &#8220;more results&#8221; and another for &#8220;new results&#8221; (reload, change subreddit, etc).  That&#8217;s why I added the extra <em>forward</em> property, which is used to determine the direction of the transition.</p>
<p>You can see it in action in this video:<br />
<iframe src="http://www.youtube.com/embed/AmIAw211cKg" frameborder="0" width="640" height="480"></iframe></p>
<h2>Next Time: Who knows?</h2>
<p>This is the <a href="http://bazaar.launchpad.net/~mhall119/+junk/uReadIt/revision/8" target="_blank">last revision</a> currently in my bzr branch.  I have some other code in the works, for Sharing using the new Friends service, and HUD integration.  But for one reason or another, neither is working quite the way I want it yet, and they haven&#8217;t been committed to my branch yet.  There were typically several days between revisions when I was developing uReadIt, and I&#8217;ve been blogging about it nearly every day since my first post.  Once I have some time to hack on uReadIt some more, I will have more to write about, so stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing the Ubuntu SDK Apps Collection</title>
		<link>http://mhall119.com/2013/04/announcing-the-ubuntu-sdk-apps-collection/</link>
		<comments>http://mhall119.com/2013/04/announcing-the-ubuntu-sdk-apps-collection/#comments</comments>
		<pubDate>Tue, 16 Apr 2013 12:00:08 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Upstream]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upstream]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1690</guid>
		<description><![CDATA[I&#8217;ve blogged three times now, here, here and here, highlighting some of the apps being written with the Ubuntu SDK.  Well after covering 44 of them, and more already popping up since yesterday&#8217;s article, we&#8217;ve decided that we need to &#8230; <a href="http://mhall119.com/2013/04/announcing-the-ubuntu-sdk-apps-collection/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/CollectionApps.png"><img class="size-medium wp-image-1691 alignleft" title="CollectionApps" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/CollectionApps-300x180.png" alt="" width="300" height="180" /></a>I&#8217;ve blogged three times now, <a title="Ubuntu SDK Apps are coming" href="http://mhall119.com/2013/03/ubuntu-sdk-apps-are-coming/" target="_blank">here</a>, <a title="More Ubuntu SDK Apps" href="http://mhall119.com/2013/04/more-ubuntu-sdk-apps/" target="_blank">here</a> and <a title="Another Ubuntu SDK Apps roundup" href="http://mhall119.com/2013/04/another-ubuntu-sdk-apps-roundup/" target="_blank">here</a>, highlighting some of the apps being written with the Ubuntu SDK.  Well after covering 44 of them, and more already popping up since yesterday&#8217;s article, we&#8217;ve decided that we need to start getting these into the Ubuntu Touch Preview images so that people can try them out on supported devices, give the developers real-use feedback and bug reports, and generally promote the amazing work being done by our community of app developers.</p>
<h2>The Collection</h2>
<p>So Alan Pope (popey) and I have kicked off what we&#8217;re calling the <a href="https://wiki.ubuntu.com/Touch/Collection" target="_blank">App Collection</a>, which are apps being developed outside of the scope of our Core Apps project, but that we still want to support, promote, and  guide through the process of getting them ready for deployment to Ubuntu devices.  This means we&#8217;re going to commit to helping developers get their apps packaged, and we&#8217;re going to be uploading them to a <a href="https://launchpad.net/~ubuntu-touch-coreapps-drivers/+archive/collection" target="_blank">new PPA</a> specifically for these apps.</p>
<h2>The Apps</h2>
<p>We&#8217;re starting out by collecting a list of known apps, with information about where to find their source code, the status of packaging for the app, and finally whether they are available in the PPA or not.  I seeded the list with the apps I&#8217;ve been blogging about, but it&#8217;s open to anybody who has an app, or knows about an app, to add it to <a href="https://wiki.ubuntu.com/Touch/Collection" target="_blank">this list</a>.</p>
<p>Apps should be in a usable state before adding them to the list, and should perform a function that might be of interest to a user or tester.  Hello World apps are great for learning, but it&#8217;s not really something that you want to promote to users.</p>
<h2>Packaging</h2>
<p>You don&#8217;t have to know about Debian packaging to get your app in our PPA, we&#8217;re going to help you bootstrap and debug your package.  Our goal is to provide the minimal amount of packaging necessary for your app to be installable, on the desktop or on devices, and work properly.  Of course, if you can provide packaging for your app, that will greatly speed up the process of getting it into the PPA.</p>
<p>We would also welcome any help from packagers. Even if you don&#8217;t have an app of your own, you can help support the app developer community by spending some time getting their packaging in order.  QML apps are relatively simple when it comes to packaging, so a seasoned packaging veteran could probably knock one out in a matter of minutes.</p>
<h2>PPA Review</h2>
<p>You won&#8217;t have to conform to all of the requirements that you will to get into the Ubuntu archives, and there won&#8217;t be a lengthy review process.  The Apps Collection is offered up for users to evaluate and test Ubuntu Touch and apps written for it, there is no guarantee of stability or security.  Generally if it installs and runs, we&#8217;ll include it in the PPA.  But we&#8217;re not crazy, and we won&#8217;t be uploading apps that are obviously malware or detrimental to the user or platform.</p>
<h2>Preview Image Review</h2>
<p>Your app will need to go through a more intense review before being approved to go into the default install of the Ubuntu Touch Preview.  You code will be inspected by the engineers responsible for the preview images, to make sure it won&#8217;t cause any problems with stability or security that would interfere with the primary goal of the preview images, which is showing off the incredible user experience that Ubuntu provides on touch devices.</p>
<h2>Inclusion</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/n7_lotsofapps.png"><img class="alignright size-medium wp-image-1694" title="n7_lotsofapps" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/n7_lotsofapps-187x300.png" alt="" width="187" height="300" /></a>Once it&#8217;s ready, your app will join the default apps being developed by Canonical, as well as Core Apps being developed by other members of the community in collaboration with Canonical project managers, as part of the demonstration platform for Ubuntu Touch.</p>
<p>This is a great opportunity for you, as a developer, to get your app in the hands of a large number of early adopters.  It&#8217;s also a great opportunity for us, being able to promote off our platform and how it is being used by the app developer community.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/announcing-the-ubuntu-sdk-apps-collection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Another Ubuntu SDK Apps roundup</title>
		<link>http://mhall119.com/2013/04/another-ubuntu-sdk-apps-roundup/</link>
		<comments>http://mhall119.com/2013/04/another-ubuntu-sdk-apps-roundup/#comments</comments>
		<pubDate>Mon, 15 Apr 2013 13:38:57 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Upstream]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upstream]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1672</guid>
		<description><![CDATA[The excitement around the Ubuntu SDK and application development is still going strong, both on the Ubuntu Touch Core Apps side and with independent developers. So strong, in fact, that it&#8217;s time for another round of updates and spotlights on &#8230; <a href="http://mhall119.com/2013/04/another-ubuntu-sdk-apps-roundup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The excitement around the Ubuntu SDK and application development is still going strong, both on the Ubuntu Touch Core Apps side and with independent developers. So strong, in fact, that it&#8217;s time for another round of updates and spotlights on the work being done.</p>
<h2>Core Apps in the Touch Preview</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/n7_installedappsicons.png"><img class="alignright size-medium wp-image-1673" title="n7_installedappsicons" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/n7_installedappsicons-187x300.png" alt="" width="187" height="300" /></a>Some big news on the Core Apps side is that they are now being reviewed for inclusion in the daily <a href="https://wiki.ubuntu.com/Touch/Install" target="_blank">Ubuntu Touch Preview</a> images being developed by Canonical for the Nexus family of devices, and by community porters to a growing number of others.</p>
<p>Now that all of the Core Apps are being regularly built and packaged in the <a href="https://launchpad.net/~ubuntu-touch-coreapps-drivers/+archive/daily/" target="_blank">Core Apps PPA</a>, they can be easily installed on desktops or devices.  And, after being reviewed by the team building the Ubuntu Touch Preview images, three of them have been selected to be part of the default installed application set. So please join me in congratulating the developers who work to them.</p>
<p>For the Calendar, <a href="https://launchpad.net/~frankencode" target="_blank">Frank Mertens</a>, <a href="https://launchpad.net/~pkunal-parmar" target="_blank">Kunal Parmar</a> and <a href="https://launchpad.net/~mariob" target="_blank">Mario Boikov</a> have done a fantastic job implementing the unique design interactions that were defined by Canonical&#8217;s design team.  For the Calculator, <a href="https://launchpad.net/~dalius-sandbox" target="_blank">Dalius Dobravolskas</a>, <a href="https://launchpad.net/~f-riccardo87" target="_blank">Riccardo Ferrazzo</a> and <a href="https://launchpad.net/~rpadovani" target="_blank">Riccardo Padovani</a> were able to quickly build something that is not only functional, but offers unique features that set it apart from other standard calculators.  Finally, the Clock app, where <a href="https://launchpad.net/~riussi" target="_blank">Juha Ristolainen</a>, Nick <a href="https://launchpad.net/~frals" target="_blank">Leppänen Larsson</a>, <a href="https://launchpad.net/~nik90" target="_blank">Nekhelesh Ramananthan</a> and <a href="https://launchpad.net/~signor-hyde" target="_blank">Alessandro Pozzi</a> have put together a visually stunning, multi-faceted application that I just can&#8217;t get enough of.</p>
<h2>New Independent App Development</h2>
<p>In addition to the work happening on the Core Apps, there has been a continuous development by independent app developers on their own projects.</p>
<h3>LoadShedding</h3>
<p>Load shedding (or rolling blackouts) are a way for electricity utilities to avoid being overloaded by energy demands at peak times.  This an be an inconvenience, to say the least, especially if you don&#8217;t know it&#8217;s coming.  Maybe that&#8217;s why developer <a href="https://launchpad.net/~razorxpress" target="_blank">razor</a> created this <a href="https://launchpad.net/loadshedding" target="_blank">LoadShedding</a> schedule app.</p>
<p><a style="color: #ff4b33; line-height: 24px;" href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/loadshedding.png"><img class="size-medium wp-image-1674 alignnone" title="loadshedding" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/loadshedding-300x233.png" alt="" width="300" height="233" /></a></p>
<h3>Multi-Convert</h3>
<p><a href="http://apps.upforward.net/?app=multiConvert" target="_blank">Multi-Convert</a> was originally an Android application, written in HTML5, that is now being <a href="http://upforward.net/?entry=4" target="_blank">ported to Ubuntu</a>.  Multi-Convert allows real-time conversion of weight, length, area, volume and temperature between different standard units.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/multiconvert.png"><img class="size-medium wp-image-1675 alignnone" title="multiconvert" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/multiconvert-174x300.png" alt="" width="174" height="300" /></a></p>
<h3> TV Remotes</h3>
<p>I ran across not one, but two different apps for the remote control of home-theater-PCs, bringing the promise of your mobile phone as a &#8220;second screen&#8221; to Ubuntu Touch.</p>
<p>First is Joseph Mills (who also created a Weather app featured in the first of these roundups), with a <a href="https://plus.google.com/u/0/106122674051576198224/posts/AJbTysJxUKY" target="_blank">remote control for MythTV</a>:</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/mythtv_remote.png"><img class="alignnone size-medium wp-image-1676" title="mythtv_remote" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/mythtv_remote-300x219.png" alt="" width="300" height="219" /></a></p>
<p>And if you&#8217;re an XBMC user instead, not to worry, because Michael Zanetti has you covered with his <a href="http://notyetthere.org/?page_id=17" target="_blank">remote control for XBMC</a>:</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/xmbc_remote.png"><img class="alignnone size-medium wp-image-1677" title="xmbc_remote" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/xmbc_remote-185x300.png" alt="" width="185" height="300" /></a></p>
<h3>CatchPodder</h3>
<p>If you use your mobile device for listening to podcasts, you&#8217;ll be pleased to find the nice and functional podcast manager <a href="https://launchpad.net/catchpodder" target="_blank">CatchPodder</a>, which lets you subscribe to multiple feeds as well as playing files directly from the server.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/catchpodder.png"><img class="alignnone size-medium wp-image-1678" title="catchpodder" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/catchpodder-161x300.png" alt="" width="161" height="300" /></a></p>
<h3>AudioBook Reader</h3>
<p>Keeping with the theme of listening to people talk on your Ubuntu device, we have an <a href="https://plus.google.com/u/0/111980561516715514914/posts/GWX73jx11tj" target="_blank">AudioBook</a> manager and player that is being written with the Ubuntu SDK, which lets you load books, display cover images, and more.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/audiobooks.png"><img class="alignnone size-medium wp-image-1686" title="audiobooks" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/audiobooks-167x300.png" alt="" width="167" height="300" /></a></p>
<h3>Bits</h3>
<p>If you&#8217;re a software developer, sysadmin or network engineer, there&#8217;s a good chance you&#8217;ve had to convert numbers between decimal, hexadecimal and binary.  This makes <a href="https://plus.google.com/u/0/111980561516715514914/posts/UfPSLjxMsdA" target="_blank">Bits</a> a very handy utility app to keep in your pocket.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/bits.png"><img class="alignnone size-medium wp-image-1679" title="bits" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/bits-222x300.png" alt="" width="222" height="300" /></a></p>
<h3>Periodic Table</h3>
<p>From the same developer who created a Software Center front-end and Pivotal Tracker (both featured in previous posts) has a new project underway, an <a href="https://plus.google.com/u/0/113125532202111335314/posts/bQ8q7B7DSNN" target="_blank">element browser</a> that gives you loads of detailed information about everything on the periodic table.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/periodic_table.png"><img class="alignnone size-medium wp-image-1680" title="periodic_table" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/periodic_table-225x300.png" alt="" width="225" height="300" /></a></p>
<h3>WebMap</h3>
<p>Canonical engineering Manager Pat McGowan has gotten into the fun too, building an app for displaying <a href="https://code.launchpad.net/~pat-mcgowan/+junk/WebMap" target="_blank">web-based maps</a> from a number of providers.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/webmaps.png"><img class="alignnone size-medium wp-image-1681" title="webmaps" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/webmaps-199x300.png" alt="" width="199" height="300" /></a></p>
<h3>GetMeWheels</h3>
<p>For Car2Go customers looking to rent or return a vehicle, <a href="http://notyetthere.org/?page_id=27" target="_blank">GetMeWheels</a> lets you easily find the nearest locations to you.  Created by the same developer as the XBMC remote, this app was originally developed for Maemo/Meego, but is now being ported to the Ubuntu SDK.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/getmewheels.png"><img class="alignnone size-medium wp-image-1682" title="getmewheels" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/getmewheels-185x300.png" alt="" width="185" height="300" /></a></p>
<h3>PlayMee</h3>
<p>A third app from the developer of GetMeWheels and XBMC Remote is <a href="http://notyetthere.org/?page_id=25" target="_blank">PlayMee</a>, a local music player that again was originally developed for Maemo/Meego, and is being ported to the Ubuntu SDK.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/playmee.png"><img class="alignnone size-medium wp-image-1683" title="playmee" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/playmee-212x300.png" alt="" width="212" height="300" /></a></p>
<h3>Tic-Tac-Toe</h3>
<p>Tic-Tac-Toe is not a fancy game, but <a href="https://plus.google.com/u/0/112509679069089605734/posts/Siy5TmLErJ9" target="_blank">this one</a> developed by Hairo Carela makes beautiful use of animation and colors, and even keeps a nice score history.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/tic-tac-toe.png"><img class="alignnone size-medium wp-image-1684" title="tic-tac-toe" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/tic-tac-toe-191x300.png" alt="" width="191" height="300" /></a></p>
<h3>LightOff</h3>
<p>If games are you thing, you should also check out <a href="https://plus.google.com/u/0/102351181217041965310/posts/HaNt8exMso9" target="_blank">LightOff</a>, a simple yet challenging game where the object is to turn off all of the lights, but clicking one toggles the state of every square around it.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/lightoff.png"><img class="alignnone size-medium wp-image-1685" title="lightoff" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/lightoff-217x300.png" alt="" width="217" height="300" /></a></p>
<p>&nbsp;</p>
<p>That&#8217;s all for now, keep those apps coming and be sure to post them in the <a href="https://plus.google.com/u/0/communities/111350780270925540549" target="_blank">Ubuntu App Developers</a> community on Google+</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/another-ubuntu-sdk-apps-roundup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building an Ubuntu SDK App: rev 7</title>
		<link>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-7/</link>
		<comments>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-7/#comments</comments>
		<pubDate>Fri, 12 Apr 2013 09:00:33 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[building-sdk-app-series]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1663</guid>
		<description><![CDATA[Hurray, it&#8217;s Friday!  I&#8217;ve got a somewhat lighter article to celebrate the end of the work week (sorry to those of you for whom it isn&#8217;t).  Today I&#8217;m going to cover revision 7, in which I replaced the large default &#8230; <a href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hurray, it&#8217;s Friday!  I&#8217;ve got a somewhat lighter article to celebrate the end of the work week (sorry to those of you for whom it isn&#8217;t).  Today I&#8217;m going to cover <a href="http://bazaar.launchpad.net/~mhall119/+junk/uReadIt/revision/7" target="_blank">revision 7</a>, in which I replaced the large default Headers with small, customized headers specifically for my app.  If you haven&#8217;t read my <a href="http://mhall119.com/tag/building-sdk-app-series/" target="_blank">previous articles</a> in this series, I strongly encourage you to do so, as each one builds on top of the one before it.</p>
<h2>New Header Component</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev7_frontpage.png"><img class="alignright size-medium wp-image-1664" title="rev7_frontpage" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev7_frontpage-191x300.png" alt="" width="191" height="300" /></a>To replace the old <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-listitems0-header.html" target="_blank">Header</a>, I first had to create the new ones.  Headers are relatively simple things, they sit on top and display text, so there wasn&#8217;t a whole lot to it.  I created an <a href="http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-item.html" target="_blank">Item</a> to act as the container.  Items are the most based UI elements in QML, all they really do is hold other elements, and provide the base type for other elements to inherit from.  Inside of the Item I put a <a href="http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-rectangle.html" target="_blank">Rectangle</a>, which is pretty much exactly what it sounds like.  What a Rectangle can do that an Item can&#8217;t is set a border and background color, which is what I wanted to do with my header.  Finally I put a <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-label.html" target="_blank">Label</a> inside of the Rectangle to contain the header.</p>
<pre><strong>Item</strong> {
    id: <strong>header</strong>
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.top:parent.top

    height: headerText.height + units.gu(1)
    <strong>Rectangle</strong>{
        anchors.fill: parent
        color: 'lightblue'
        border.width: 1
        border.color: 'grey'
        <strong>Label</strong> {
            id: headerText
            anchors.centerIn: parent
            text: ''
            fontSize: 'large'
            font.bold: true
        }
    }
}</pre>
<p>You can see that I set the <em>anchors</em> for the Item to place it at the top of it&#8217;s parent (SubredditListView in this case) which is important for reasons you&#8217;ll see below.  I also set the Rectangle&#8217;s background color to &#8216;lightblue&#8217;. For the <em>subreddit</em> page I made the <em>fontSize</em> large, bold, and centered in the header (that&#8217;s what <em>anchors.centerIn: parent</em> does).  That works for the short text name of a Subreddit, but for the article I needed something a little bit different.</p>
<pre><strong>Item</strong> {
    id: <strong>header</strong>
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.top:parent.top
    visible: false
    height: headerText.contentHeight + units.gu(1)
    <strong>Rectangle</strong>{
        anchors.fill: parent
        color: 'lightblue'
        border.width: 1
        border.color: 'grey'
        <strong>Label</strong> {
            id: headerText
            anchors.fill: parent
            anchors.verticalCenter: parent.verticalCenter
            anchors.margins: units.gu(0.5)
            font.bold: false
            wrapMode: Text.WrapAtWordBoundaryOrAnywhere
        }
    }
}</pre>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev7_article.png"><img class="alignright size-medium wp-image-1665" title="rev7_article" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev7_article-191x300.png" alt="" width="191" height="300" /></a>Here I made left the Label text it&#8217;s default size, and not bold.  I also didn&#8217;t center it horizontally like I did for the <em>subreddit</em> page.  But most importantly, I set the text to wrap so that articles with an overly long title will flow over multiple lines, increasing the size of the header to accommodate it.</p>
<h2>Keeping it up to date</h2>
<p>Since I was already passing the full <em>article</em> data data to the ArticleView component, extracting the new title and updating it was easy to do, I just needed to add a line to the onArticleChanged callback.</p>
<pre>    onArticleChanged: {
        if (article) {
            articleWebView.url = article.data.url
            <strong>headerText.text = article.data.title</strong>
        }
    }</pre>
<p>But changing the header on the SubredditListView required a little more work.  Since I already had a property on it called <em>subreddit</em>, I was able to write an onSubredditChanged callback to run whenever I needed to update the Subreddit name in this header.</p>
<pre>    <strong>onSubredditChanged</strong>: <strong>updateHeader</strong>()
    Component.onCompleted: updateHeader()
    function <strong>updateHeader</strong>() {
        if (subreddit == '') {
            <strong>headerText.text</strong> = 'Frontpage'
        } else {
            <strong>headerText.text</strong> = subreddit
        }
    }</pre>
<h2>Next time: Transitions</h2>
<p>One of the really neat things about QML is that it makes developing rich, fancy interfaces very easy.  And part of how it does this is by building support for transition animations right in at the ground level.  I knew from the beginning of this project that I wanted to try them out, and in the next revision I finally took the opportunity to add them.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building an Ubuntu SDK App: rev 5-6</title>
		<link>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-5-6/</link>
		<comments>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-5-6/#comments</comments>
		<pubDate>Thu, 11 Apr 2013 09:00:40 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[building-sdk-app-series]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1646</guid>
		<description><![CDATA[Well I&#8217;m back again, with part 4 of this series.  No, that&#8217;s not a typo in the title, this post will be primarily about revision 5 and revision 6 of my bzr branch.  What happened to rev 4?  Well it was &#8230; <a href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-5-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well I&#8217;m back again, with part 4 of this series.  No, that&#8217;s not a typo in the title, this post will be primarily about <a href="http://bazaar.launchpad.net/~mhall119/+junk/uReadIt/revision/5" target="_blank">revision 5</a> and <a href="http://bazaar.launchpad.net/~mhall119/+junk/uReadIt/revision/6" target="_blank">revision 6</a> of my bzr branch.  What happened to rev 4?  Well it was pretty boring to be honest, just removing some console.log() calls that I used as a poor excuse for a debugger.  Anyway, boring.</p>
<p>If you haven&#8217;t read the previous articles in this series, you&#8217;ll want to do that before reading any further here:</p>
<ul>
<li><a title="Building an Ubuntu SDK App: rev 1" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-1/" target="_blank">Rev 1: Creating a project, ListViews &amp; ListModels</a></li>
<li><a title="Building an Ubuntu SDK App: rev 2" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-2/" target="_blank">Rev 2: ListItem thumbnails, Dialogs and WebKit</a></li>
<li><a title="Building an Ubuntu SDK App: rev 3" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-3/" target="_blank">Rev 3: Refactoring, visual improvements &amp; gesture controls</a></li>
</ul>
<h2>Comments</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev5_article.png"><img class="alignright size-medium wp-image-1647" title="rev5_article" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev5_article-191x300.png" alt="" width="191" height="300" /></a>Everybody knows that comments are half the fun of Reddit, but up until now uReadIt wasn&#8217;t able to view them.  Now, the proper way to do this would be to use the Reddit API to download the comment threads, and load them using nested ListViews.  But that&#8217;s going to take a while, and I wanted comments <strong><em>now</em></strong>.  So I cheated, took the easy way out, and just used the existing WebView to load the Reddit comments page URL instead.  I&#8217;ll do it the right way in a later revision&#8230;.probably.</p>
<p>The first thing I needed was a way to load comments instead of the article content.  This meant finally using the <em>Comments</em> toolbar action I put in place earlier.  But I needed a way to change back too, nobody likes a one-way trip, so I added an <em>Article</em> action as well.</p>
<pre>    Action {
        id: <strong>commentAction</strong>
        objectName: "comment"
        visible: true

        iconSource: Qt.resolvedUrl("comments.png")
        text: i18n.tr("Comments")

        onTriggered: {
            articleContent.<strong>showComments</strong>()
            <strong>articleAction</strong>.enabled = true
            <strong>commentAction</strong>.enabled = false
            articleViewActions.active = false
        }
    }
    Action {
        id: <strong>articleAction</strong>
        objectName: "article"
        enabled: false

        iconSource: Qt.resolvedUrl("avatar.png")
        text: i18n.tr("Article")

        onTriggered: {
            articleContent.<strong>showArticle</strong>()
            <strong>commentAction</strong>.enabled = true
            <strong>articleAction</strong>.enabled = false
            articleViewActions.active = false
        }
    }</pre>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev5_comments.png"><img class="alignright size-medium wp-image-1648" title="rev5_comments" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev5_comments-191x300.png" alt="" width="191" height="300" /></a>Then I had to write the <em>showComments</em> and <em>showArticle</em> functions, which would switch the WebView.url from one to the other.  There was just one problem, that code didn&#8217;t have the comments url, only the content url.  So first I had to pass more data to my <em>articleView</em> page.  To avoid having to do this again, I decided to just pass it the whole article data model that I was getting from JSONListModel, that way I would have all the data I could potentially need for future features.</p>
<p>Since I created a new property called <em>article</em>, I also get a callback handler called <em>onArticleChanged</em>, which I took advantage of to determine if an article&#8217;s content was already a link to a Reddit comment page, and if so disabling the option to switch between Article and Comments.</p>
<pre>Page {
    id: articleView
    title: 'Article'
    property var <strong>article</strong>: undefined

    <strong>onArticleChanged</strong>: {
        if (article) {
            articleContent.<strong>article</strong> = <strong>article</strong>
            commentAction.enabled = !<strong>article</strong>.data.is_self
            articleAction.enabled = false
            articleView.title = article.data.title
            articleContent.visible = true
        }
    }</pre>
<p>Now I could finally implement <em>showComments</em> and <em>showArticle</em>, which I decided to do inside of ArticleView.  To support that, I would also need to pass the article data model on again, this time to ArticleView.  Then I could use that data to switch the WebView&#8217;s url.</p>
<pre>Item {
    property var <strong>article</strong>: undefined
    property string baseUrl: 'http://www.reddit.com'

    onArticleChanged: {
        if (article) {
            articleWebView.url = <strong>article</strong>.data.url
        }
    }
    ...
    function <strong>showComments</strong>() {
        console.log('Comments: '+baseUrl + <strong>article</strong>.data.permalink)
        articleWebView.url = baseUrl + <strong>article</strong>.data.permalink
    }
    function <strong>showArticle</strong>() {
        articleWebView.url = <strong>article</strong>.data.url
    }</pre>
<h2>Subreddit Filters</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev5_filter.png"><img class="alignright size-medium wp-image-1655" title="rev5_filter" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev5_filter-191x300.png" alt="" width="191" height="300" /></a>I usually only read the <em>Hot</em> subreddit filter, I&#8217;ve only used <em>New</em> a handful of times, but like I said in the first article in this series, I&#8217;m going things to learn the Ubuntu SDK, not make a Reddit app.  I wanted to write some code that used the Ubuntu <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-popups0-popover.html" target="_blank">Popups.Popover</a> component, and changing Reddit filters seemed like a good use for that kind of component.</p>
<p>Like <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-popups0-dialog.html" target="_blank">Popups.Dialog</a>, using a Popover is relatively simple.  You start with a Component to contain your popup, add your components to it, then call PopupUtils.open.  For changing filters, I chose to just put in a Column filled with <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-listitems0-standard.html" target="_blank">ListItem.Standard</a> items, one for each filter.  When one of them is selected, it will change a new <em>filter</em> property on my SubredditListView (which will reload from Reddit using the new filter).</p>
<pre>Component {
    id: popoverComponent
    Popups.Popover {
        id: popover
        Column {
            id: containerLayout
            ...
            ListItem.Standard {
                text: "Hot"
                selected: articleList.<strong>filter</strong> == 'hot'
                onClicked: {
                    articleList.<strong>filter</strong> = 'hot'
                    PopupUtils.close(popover)
                }
            }
            ListItem.Standard {
                text: "New"
                selected: articleList.<strong>filter</strong> == 'new'
                onClicked: {
                    articleList.<strong>filter</strong> = 'new'
                    PopupUtils.close(popover)
                }
            }
            ListItem.Standard {
                text: "Rising"
                selected: articleList.<strong>filter</strong> == 'rising'
                onClicked: {
                    articleList.<strong>filter</strong> = 'rising'
                    PopupUtils.close(popover)
                }
            }
            ListItem.Standard {
                text: "Controversial"
                selected: articleList.<strong>filter</strong> == 'controversial'
                onClicked: {
                    articleList.<strong>filter</strong> = 'controversial'
                    PopupUtils.close(popover)
                }
            }
            ListItem.Standard {
                text: "Top"
                selected: articleList.<strong>filter</strong> == 'top'
                onClicked: {
                    articleList.<strong>filter</strong> = 'top'
                    PopupUtils.close(popover)
                }
            }
        }
    }
}
tools: ToolbarActions {
    ...
    Action {
        id: <strong>filterAction</strong>
        objectName: "filterAction"

        iconSource: Qt.resolvedUrl("settings.png")
        text: i18n.tr("Filter")

        onTriggered: {
            PopupUtils.open(<strong>popoverComponent</strong>, <strong>filterAction</strong>.itemHint)
        }
    }
}</pre>
<p><span style="color: #000000; font-size: 1.8em; line-height: 1.5em;">Packaging</span></p>
<p>Finally I was ready to package uReadIt, to make it easy to install.  I copied my packaging files from what was used by the Ubuntu Touch <a href="https://wiki.ubuntu.com/Touch/CoreApps" target="_blank">Core Apps</a>, which was itself copied from packaging files used by the notepad-qml app.  Now I&#8217;ll admit, it&#8217;s not perfect, and we&#8217;ve already had patches submitted to fix the Core Apps packaging, changes which I will be applying to uReadIt at some point.  So don&#8217;t take these as the right way to package your app, I&#8217;m putting them here to explain in a broad sense what the different files do in a Debian package.</p>
<h3>debian/control</h3>
<p>The control file gives all of the data about your package.  It has two sections, the first is for the source package, it contains the source package name, list of dependent packages needed to build your app and package, and some other miscellaneous information used by the packaging system.  Below that will be one or more binary package definitions.  I only have one, you probably will too.  This section contains another list of dependent packages, but these are packages needed to run your app, not build it. It also contains a space to describe your application.  The first line of the Description should be a brief description, used when listing a lot of packages together, and the lines below it should have a longer description, used when showing more information about a single package.</p>
<pre>
Source: ureadit
Priority: extra
Maintainer: Michael Hall <mhall119@ubuntu.com>
Build-Depends: debhelper (>= 8.0.0), 
Standards-Version: 3.9.4
Section: misc
Homepage: https://launchpad.net/~mhall119/

Package: ureadit
Section: misc
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends},
         qmlscene,
         qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
         qtdeclarative5-qtquick2-plugin
Description: Reddit Browser
 Desktop application for browsing Reddit, it's articles and comments
</pre>
<h3>debian/rules</h3>
<p>The rules file is what actually does the building, it&#8217;s like a Makefile for your package.  Ideally this doesn&#8217;t do much more than calling <em>dh</em> (debhelper).  In fact, mine should be doing that, but it has a lot of unnecessary complication due to being copied from one project to another to another.  You&#8217;re probably better of just ignoring mine, just remember that debian/rules does the building.</p>
<pre>
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Work-around for some machines where INSTALL_ROOT is not set properly by
# dh_auto_install
override_dh_auto_install:
	dh_auto_install -- INSTALL_ROOT=$(CURDIR)/debian/tmp

# Workaround a bug in that debhelper package version
override_dh_install:
	mkdir -p $(CURDIR)/debian/tmp/usr/share/applications/
	mkdir -p $(CURDIR)/debian/tmp/usr/bin/
	mkdir -p $(CURDIR)/debian/tmp/usr/share/uReadIt/
	cp uReadIt.desktop $(CURDIR)/debian/tmp/usr/share/applications/
	cp uReadIt.bin $(CURDIR)/debian/tmp/usr/bin/uReadIt
	cp -r *.qml *.js *.png $(CURDIR)/debian/tmp/usr/share/uReadIt/
	
	dh_install --sourcedir=debian/tmp --fail-missing

%:
	dh $@
</pre>
<h3>debian/changelog</h3>
<p>The changelog file contains a record of revisions to your package, just like a bzr or git changelog.  More importantly, the changelog is what tells debhelper the lasted version of your package.  So the (0.3) in the top line on mine tells it to build ureadit_0.3_all.deb.  It will also use the signature line to try and find a matching GPG key when signing packages.</p>
<pre>
ureadit (0.3) raring; urgency=low

  * Initial release

 -- Michael Hall <mhall119@ubuntu.com>  Mon, 25 March 2013 23:09:00 -0400
</pre>
<h3>debian/copyright</h3>
<p>Making sure that FOSS packages can be distributed, modified, and redistributed is important, so in Debian and Ubuntu having a properly formed copyright file is a requirement.  I won&#8217;t go into much detail on how to do this, the link at the top will take you to the official spec.  The key pieces are the sections that give a <a href="http://en.wikipedia.org/wiki/Glob_(programming)" target="_blank">file glob</a>, license and attribution.  You can have as many of these sections as you need to properly cover all of your app.</p>
<pre>
Format: http://dep.debian.net/deps/dep5
Upstream-Name: uReadIt
Source:

Files: *
Copyright: 2013 Michael Hall
License: GPL-3.0

Files: debian/*
Copyright: 2013 Michael Hall
License: LGPL-3.0
</pre>
<h2>Next time: Customizing headers</h2>
<p>The stock Ubuntu component <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-listitems0-header.html" target="_blank">Headers</a> are nice, but they weren&#8217;t serving my purposes.  I wanted them to display more text, and ideally take up less room.  So in the next revision, I replaced them with some custom components that did exactly what I wanted.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-5-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Building an Ubuntu SDK App: rev 3</title>
		<link>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-3/</link>
		<comments>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-3/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 09:00:52 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[building-sdk-app-series]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1622</guid>
		<description><![CDATA[This is part 3 of an ongoing series, you should read rev 1 and rev 2 first. In this revision I make several visual improvements to the existing components, try out some new gesture-based interactions, and undergo a significant refactoring &#8230; <a href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is part 3 of an ongoing series, you should read <a title="Building an Ubuntu SDK App: rev 1" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-1/">rev 1</a> and <a title="Building an Ubuntu SDK App: rev 2" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-2/">rev 2</a> first.</p>
<p>In this revision I make several visual improvements to the existing components, try out some new gesture-based interactions, and undergo a significant refactoring effort to separate my code into smaller, cleaner files.</p>
<h2>The Refactor</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_refactor1.png"><img class="alignright size-medium wp-image-1625" title="rev3_refactor" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_refactor1-300x153.png" alt="" width="300" height="153" /></a>For the refactor, I wanted to split my app into logical components, based largely on the QML Components, but grouping the major and minor components that could be treated as a single entity.</p>
<p>I started by separating the components for each of my Pages, <em>subreddits</em> and <em>articleView</em>, into independent QML files that I could treat as single components when adding them to my Page.  For the SubredditListView, I further separated the model code (based on the JSONListModel) and delegate code (based on ListItem.Subtitled) into their own files.</p>
<p>These changes would allow me build domain-specific functionality on top of the base components in the Ubuntu SDK, while keeping my main code file uncluttered by all of that code.  My main file, uReadIt.qml, could then focus solely on layout and navigation.</p>
<h2>Connecting the dots</h2>
<p>I went out of my way to avoid inter-dependency between these components, so the ArticleListItem doesn&#8217;t need to know about the ArticleView.  But I wanted to change my ArticleView whenever an ArticleListItem was clicked.  This meant I had provide aliases, signals and callback handlers on my top-level components, and they connect them together in my main file.</p>
<p>I gave my SubredditListView an itemClicked signal, which would automatically provide an onItemClicked callback property that I could access from uReadIt.qml.  Then, in my delegate&#8217;s onClicked callback, I simply fired off the signal with a reference to the ListModel item.</p>
<pre>Item {
    ...
    signal <strong>itemClicked</strong>(var model)
    ...
    ListView {
        id: articleList
        ...
        delegate: ArticleListItem {
            id: articleItemDelegate
            onClicked: {
                <strong>itemClicked</strong>(model)
            }
        }
        ...
    }
    ...
}</pre>
<p>Then in my ArticleView code, I made a property alias called url that was linked to the url property on the inner WebView component.  Setting ArticleView.url would then behave exactly like setting WebView.url did.</p>
<pre>Item {
    property alias <strong>url</strong>: <strong>articleWebView.url</strong>
    ...
    WebView {
        id: <strong>articleWebView</strong>
        <strong>url</strong>: ""
        ...
    }
    ...
}</pre>
<p>Finally, in uReadIt.qml, I set the onItemClicked handler for my SubredditListView to change the url property on my ArticleView,</p>
<pre>    PageStack {
        id: pageStack
        ...
        Page {
            id: subreddits
            ...
            <strong>SubredditListView</strong> {
                id: articleList
                ...
                <strong>onItemClicked</strong>: {
                    articleView.title = model.data.title
                    <strong>articleContent</strong>.<strong>url</strong> = model.data.url
                    articleContent.visible = true
                    pageStack.push(articleView)
                }
            }
            ...
        }
        Page {
            id: articleView
            title: 'Article'

            <strong>ArticleView</strong> {
                id: <strong>articleContent</strong>
                ...
            }
        }
        ...
    }
}</pre>
<h2>Visual tweaks</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_frontpage.png"><img class="alignright size-medium wp-image-1630" title="rev3_frontpage" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_frontpage-191x300.png" alt="" width="191" height="300" /></a>Alright, enough of the refactoring, I managed to do some more interesting and fun things in this revision as well.  For one thing, I improved the look of thumbnails on the ListView by giving different icons for in-Reddit articles, as well as NSFW and &#8216;default&#8217; articles.  I also restricted their size to 5&#215;5 grid units.</p>
<p>A <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/resolution-independence.html" target="_blank">Grid Unit</a> is a resolution-independent way of defining size of things in the Ubuntu SDK.  Instead of using pixels, which don&#8217;t work on both high and low density displays, or using physical units which don&#8217;t work on both hand-held and 10-foot displays, the Ubuntu SDK uses a Grid Unit.  The number of pixels in a grid unit depends on the device your app is running on.  On high-density displays, like the Retina displays on new Macs, your grid unit will use more pixels than on a standard resolution LCD, so that a Grid Unit is roughly the same physical size on both.  Likewise, on a television screen meant to be viewed from across the room, a grid unity will have a larger physical size than it would when running on a hand-held device, even if they are both 1080p screens.</p>
<pre>ListItem.Subtitled {
    text: model.data.title
    subText: '('+model.data.domain+') - ' + model.data.score + ' - ' + model.data.subreddit + ' - ' + model.data.author
    icon: {
        var icon = model.data.thumbnail;
        if (icon == 'self') {
            icon = Qt.resolvedUrl("reddit.png");
        } else if (icon == 'default') {
            icon = Qt.resolvedUrl("avatar.png");
        } else if (icon == 'nsfw') {
            icon = Qt.resolvedUrl("settings.png");
        }

        return icon;
    }
    <strong>__iconHeight</strong>: <strong>units.gu</strong>(5)
    <strong>__iconWidth</strong>: <strong>units.gu</strong>(5)
    progression: true
}</pre>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_loading1.png"><img class="alignright size-medium wp-image-1635" title="rev3_loading" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_loading1-191x300.png" alt="" width="191" height="300" /></a>In addition to these changes to the ListView, I was also getting tired of wondering if my content was being slow to load, or if it had failed for some reason, so I wanted to add a loading progress bar to my ArticleView.</p>
<p>To do this, I used the <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-progressbar.html" target="_blank">ProgressBar</a> component from the Ubuntu SDK, and connected it to the loading property for the WebView component.  First I set the visibility of the progress bar to the loading status of the content with the onLoadingChanged callback.  If it was loading, the bar was visible, and when it wasn&#8217;t the bar was hidden.  Next I used the onLoadProgressChanged to set the progress bar&#8217;s value to the current loading progress of the content.  Once everything was connected, QML made it all just work.</p>
<pre>    WebView {
        id: articleWebView
        ...
        <strong>onLoadingChanged</strong>: {
            <strong>loadProgressBar</strong>.visible = loading
        }

        <strong>onLoadProgressChanged</strong>: {
            <strong>loadProgressBar</strong>.value = loadProgress
        }
    }
    ProgressBar {
        id: <strong>loadProgressBar</strong>
        ...
        minimumValue: 0
        maximumValue: 100
    }</pre>
<h2>Dragging gestures</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_dragformore.png"><img class="alignright size-medium wp-image-1640" title="rev3_dragformore" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev3_dragformore-191x300.png" alt="" width="191" height="300" /></a>Finally I started to experiment with drag-gestures for moving from one page of results to the next, or reloading the subreddit entirely.  This was pretty tricky, the ListView component doesn&#8217;t provide any single property to tell you how far past the either end a user drag or flick has moved the content.  However, it does provide a <em>contentY</em> property that I could use to, eventually, calculate how far off the natural bounds the user has moved the content.</p>
<p>First I created a callback handler for <em>onContentYChanged</em> so that my app was aware of the content movement within the ListView.  Then, if Qt says the user was dragging the content (as opposed to movement caused by a flick), I would calculate the over-drag for both the top and bottom of the list.  I didn&#8217;t want to trigger an event for small drag distances, so below a certain threshold it will give instructions to continue dragging to perform an action, and beyond that threshold the text will change to tell the user to let go of the drag to initiate that action.</p>
<h2>Next time: Packaging</h2>
<p>By now I had an app that I wanted to use regularly on my Nexus 7.  Previously I had been running it from QtCreator by pressing Ctrl+F12 while I had my N7 connected via a USB cable, but that meant I could only start it when I was plugged into my laptop.  Not ideal for in-bed Reddit browsing.  So in the 4th revision of my code branch I added Debian packaging files for easy installation.</p>
<p><a title="Building an Ubuntu SDK App: rev 5-6" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-5-6/">Read the next article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Building an Ubuntu SDK App: rev 2</title>
		<link>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-2/</link>
		<comments>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-2/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 09:00:56 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[building-sdk-app-series]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1582</guid>
		<description><![CDATA[In my previous article I discussed how I got started with a new Ubuntu SDK app, and how easy it was to get a listing of Reddit articles displayed in a simple list. In my second revision, I added image &#8230; <a href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my <a title="Building an Ubuntu SDK App: rev 1" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-1/">previous article</a> I discussed how I got started with a new Ubuntu SDK app, and how easy it was to get a listing of Reddit articles displayed in a simple list. In my <a href="http://bazaar.launchpad.net/~mhall119/+junk/uReadIt/revision/2" target="_blank">second revision</a>, I added image thumbnails to that list, the ability to change to a different subreddit, and finally the capability to actually display the article&#8217;s content.<span id="more-1582"></span></p>
<h2>Thumbnails</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev2_homepage.png"><img class="alignright size-medium wp-image-1585" title="rev2_homepage" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev2_homepage-191x300.png" alt="" width="191" height="300" /></a>For some subreddits, Reddit will provide an image thumbnail to go along with the article.  Not only is this a nice feature of Reddit, but it&#8217;s also supplied as part of their API.  Since <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-listitems0-subtitled.html" target="_blank">ListItem.Subtitled</a> derives from <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-listitems0-base.html" target="_blank">ListItem.Base</a>, it also has an optional <em>icon</em> property that can conveniently take a URL.  This made adding the thumbnail to my ListView incredibly easy.</p>
<p>Since not all articles have a thumbnail image, for now I just used a placeholder (the avatar image you get from the template).  I also didn&#8217;t do anything to make sure the images would fit in the ListItem.  In later revisions I would get a little smarter about how I handled thumbnails.</p>
<hr style="clear: both; visibility: hidden;" />
<pre>ListView {
    id: articleList
    ...
    delegate: ListItem.Subtitled {
        ...
        icon: (model.data.thumbnail) ? model.data.thumbnail : Qt.resolvedUrl("avatar.png")
        ...
    }
}</pre>
<h2>Changing Subreddits</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev2_changesubreddit.png"><img class="alignright size-medium wp-image-1591" title="rev2_changesubreddit" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev2_changesubreddit-191x300.png" alt="" width="191" height="300" /></a>Now that the subreddit article list in a pretty good state, I turned my attention to being able to change from one subreddit to another.  Revision 1 had a text input and button for this, but due to my not understanding QML layout this was hidden behind the header in those earlier screenshots.</p>
<p>So this time I decided to use another Ubuntu SDK component, <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-popups0-dialog.html" target="_blank">Popups.Dialog</a>, to show the form as an overlay on top of the article list.  This was very simple to do, and it looks so much nicer and more professional too.  The default theme that you get with the Ubuntu SDK makes it easy to make good looking apps, even if you&#8217;re not a designer.</p>
<p>The Dialog itself is straight forward, you simply wrap it up in a Component (you&#8217;ll see why later), give it a title and a bit of descriptive text for the user, and add your widgets to it.  All I needed was a <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-textfield.html" target="_blank">TextField</a> and a <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-button.html" target="_blank">Button</a>.  Since the Reddit &#8220;Frontpage&#8221; doesn&#8217;t have a subreddit, I decided to use no subreddit value to mean &#8220;Frontpage&#8221;, and used the TextField&#8217;s <em>placeholderText</em> property to display that when the TextField was empty (and yes I called it &#8220;Homepage&#8221; at first, I did correct it in later revisions).</p>
<pre>    Component {
         id: dialogComponent
         Popups.Dialog {
             id: dialog
             title: "Change Subreddit"
             text: "Select a new Subreddit"

             TextField {
                 id: subreddit
                 placeholderText: 'Homepage'
                 text: currentSubreddit
             }
             Button {
                 id: 'goButton'
                 text: 'Go'
                 color: 'green'
                 onClicked: {
                     currentSubreddit = subreddit.text
                     PopupUtils.close(dialog)
                 }
             }
         }
    }</pre>
<p>To call up the dialog, I added a new button to the bottom toolbar.  Since I hadn&#8217;t added any before (the &#8220;Back&#8221; button was provided by PageStack) I had to give my <em>subreddits</em> page a property called <em>tools</em> that contains a <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-toolbaractions.html" target="_blank">ToolbarActions</a> instance.  Inside of that, I was able to add an <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-action.html" target="_blank">Action</a> for opening my dialog.  Here is why you needed to wrap your Dialog in a Component, because it&#8217;s the component that you need to pass to <em>PopupUtils.open</em>.</p>
<pre>    tools: ToolbarActions {
        Action {
            id: subredditAction
            objectName: "action"

            iconSource: Qt.resolvedUrl("avatar.png")
            text: i18n.tr("Subreddit")

            onTriggered: {
                PopupUtils.open(dialogComponent, subredditAction.itemHint)
            }
        }
    }</pre>
<p>&nbsp;</p>
<h2>Viewing Articles</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev2_article.png"><img class="alignright size-medium wp-image-1599" title="rev2_article" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev2_article-191x300.png" alt="" width="191" height="300" /></a>Now that I could change subreddits, and my subreddit article list was starting to look pretty good, I really, Really wanted to be able to view the contents of those articles.  Since I had no idea what the contents would be (webpage, image, video, reddit comments page), I wanted to be able to display anything that could be posted to Reddit, which essentially means I needed a browser.</p>
<p>Fortunately, the popular and powerful <a href="http://qt-project.org/doc/qt-5.0/qtwebkit/qtwebkit-index.html" target="_blank">WebKit</a> browser engine has a Qt component, which makes adding it to a QML dead simple.  So in my <em>articleView</em> page, I just needed to add the <a href="http://qt-project.org/doc/qt-5.0/qtwebkit/qml-qtwebkit3-webview.html" target="_blank">WebView</a> component. I did have to set the <em>visible</em> property to false, otherwise it would display the content of the WebView, even when the <em>articleView</em> page wasn&#8217;t (I suspect it has something to do with WebKit taking over rendering from Qt/QML).</p>
<pre>Page {
    id: articleView
    title: 'Article'

    WebView {
        id: articleContent
        anchors.fill: parent
        url: ""
        scale: 1
        visible: false
    }
}</pre>
<p>And then in the ListItem.onClicked callback handler I defined earlier, in addition to pushing the <em>articleView</em> page on to the top of the PageStack, I also had to set the <em>url</em> property of the WebView. I also set the title of the <em>articleView</em> page to be the article&#8217;s title. Finally, I have this callback set the visibility to true to that it would actually be displayed.</p>
<pre>ListView {
    id: articleList
    ...
    delegate: ListItem.Subtitled {
        ...
        onClicked: {
            articleView.title = model.data.title
            articleContent.url = model.data.url
            articleContent.visible = true
            pageStack.push(articleView)
        }
    }
}</pre>
<h2>Property Change handlers</h2>
<p>One important bit of code that changed in this revision was the addition of a global <em>currentSubreddit</em> property (you can see it being used in the change subreddit dialog). In QML, any property you define will automatically get an <em>on&lt;Property&gt;Changed</em> callback. This means that I got an onCurrentSubredditChanged callback (camel case, which means the first letter of your property name is capitalized), so I used that to make the appropriate changes to the other components in my app.</p>
<pre>    property string currentSubreddit: ''
    function onCurrentSubredditChanged() {
        console.debug('Changing Subreddit: '+currentSubreddit)
        if (currentSubreddit != '') {
            subredditFeed.source = "http://www.reddit.com/hot.json"
            subreddits.title = 'Homepage'
        } else {
            subredditFeed.source = "http://www.reddit.com/r/"+currentSubreddit+"/hot.json"
            subreddits.title = '/r/'+currentSubreddit
        }

        pageStack.clear()
        pageStack.push(subreddits)
    }</pre>
<p>Another consequence of getting these automatic property change callbacks, is that you usually just need to change a component&#8217;s property in order to get it to do something. In this case, changing the <em>source</em> property on my JSONListModel was enough to make it load the new Reddit API data, which was then enough for my ListView to drop it&#8217;s currently items and add the new ones just loaded into the model. It really does border on magical sometimes.</p>
<h2>Next time: Refactoring</h2>
<p>Up until this point, all of the code I&#8217;ve been writing was in a single uReadIt.qml file, and it was starting to get rather large. But with QML it doesn&#8217;t need to be that way (and really, it shouldn&#8217;t be that way), so for revision 3 I decided to split it out into separate files.</p>
<p><a title="Building an Ubuntu SDK App: rev 3" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-3/">Read the next article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>UDS 13.05: Ubuntu&#8217;s second online developer summit</title>
		<link>http://mhall119.com/2013/04/uds-13-05-ubuntus-second-online-developer-summit/</link>
		<comments>http://mhall119.com/2013/04/uds-13-05-ubuntus-second-online-developer-summit/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 00:20:47 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[uds]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1608</guid>
		<description><![CDATA[It&#8217;s official, UDS 13.05 is coming up next month, marking our second online Ubuntu Developer Summit, and coming only two months after the last one. While going virtual was part of our transition to make Ubuntu&#8217;s development more open and &#8230; <a href="http://mhall119.com/2013/04/uds-13-05-ubuntus-second-online-developer-summit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s official, <a href="http://summit.ubuntu.com/uds-1305/" target="_blank">UDS 13.05</a> is coming up next month, marking our second online Ubuntu Developer Summit, and coming only two months after the last one. While going virtual was part of our transition to make Ubuntu&#8217;s development more open and inclusive, the other side of that coin was to start holding them more often. The first we put into affect in March, and the second is coming in May. Read below for information about this UDS, and changes that have been made in response to feedback from the last one.<span id="more-1608"></span></p>
<h2>Scheduling</h2>
<p>The dates for UDS 13.05 are<strong> May 14, 15 and 16</strong>, from<strong> 1400 UTC to 2000 UTC</strong>.  We will once again have 5 tracks: App Development, Community, Client, Server &amp; Cloud and Foundations.  The track leads for these will be:</p>
<ul>
<li><strong>App Development</strong>: Alan Pope, David Planella &amp; Michael Hall</li>
<li><strong>Community</strong>: Daniel Holbach, Nick Skaggs &amp; Jono Bacon</li>
<li><strong>Client</strong>: Jason Warner &amp; Sebastien Bacher</li>
<li><strong>Server &amp; Cloud</strong>: Dave Walker &amp; Antonio Rosales</li>
<li><strong>Foundations</strong>: Steve Langasek</li>
</ul>
<p>Track leads will be in charge of approving Blueprints and getting them on the schedule.  If you are going to be responsible for running a session, please get with the track lead to make sure they have marked you as being required for that session. If you would like to get a session added for this UDS, you can do so either through <a href="https://wiki.ubuntu.com/UDS/Create" target="_blank">registering a Blueprint</a> or proposing a meeting <a href="http://www.youtube.com/watch?v=Jr25brEMOuA" target="_blank">through Summit</a> itself.  Both approaches will require the approval of a Track Lead, so make sure you discuss it with them ahead of time.</p>
<h2>Changes to&#8230;</h2>
<p>Using feedback from attendees of the March UDS, we will be implementing a number of changes for UDS 13.05 to improve the experience.</p>
<h3>Hangouts</h3>
<p>Google+ Hangouts have a limit of 15 active participants (if started with a Canonical user account, it&#8217;s 10 if you don&#8217;t have a Google Apps domain), but in practice we rarely had that many people join in the last UDS.  This time around we&#8217;re going to encourage more people to join the video, especially community participants, so please check your webcams and microphones ahead of time to be ready.  If you want to join, just ask one of the session leaders on IRC for the hangout URL. We are also investigating ways to embed the IRC conversations in the Hangout window, to make it easier for those on the video to keep track of the conversation happening there.</p>
<h3>The Plenaries</h3>
<p>Most people agreed that the mid-day plenaries didn&#8217;t work as well online as they do in person.  There was also a desire to have a mid-day break to allow people to eat, stretch, or hold a sidebar conversation with somebody.  So we are replacing the mid-day plenaries with a &#8220;lunch&#8221; slot, giving you an hour break to do whatever you need to do. We will be keeping the introductory plenary on the morning of the first day, because that helps set the tone, goals and information needed for the rest of the week.  In addition to that, we have added back a closing plenary at the end of the last day, where track leads will be able to give a summary of the discussions and decisions made.</p>
<h3>The Schedule</h3>
<p>In addition to the above plenary changes, we have added an extra day to this UDS, making it 3 days instead of two.  The last day will allow for overflow of sessions that couldn&#8217;t fit into 2 days, or the scheduling of follow-up session when it is determined they are necessary following a discussion earlier in the week.</p>
<h3>Registration</h3>
<p>Registration to attend will now be done in Summit itself, rather than through a Launchpad Sprint.  So if you&#8217;re not a track lead, and you&#8217;re not registering Blueprints, there&#8217;s nothing you need to do on Launchpad itself.  This will help those who do not have a Launchpad profile, though you will still need an Ubuntu SSO account to log in.</p>
<p>To register for UDS 13.04, go to the <a href="http://summit.ubuntu.com/uds-1305/" target="_blank">summit page</a>, and just above the schedule you will see an orange &#8220;Register in Summit&#8221; button.  If you don&#8217;t see that, you either need to log in to  summit or you&#8217;ve already registered.</p>
<h3>Summit Scheduler</h3>
<p>Chris Johnston and Adnane Belmadiaf have been working hard to improve the <a href="https://launchpad.net/summit/" target="_blank">Summit Scheduler</a> website, taking feedback from attendees to improve the interface and workflow of the site.  We will include as many enhancements as possible before the start of UDS 13.05.  If you are interested in helping improve it, and you have some web development skills, please find them on #ubuntu-website on Freenode to find out how you can get involved.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/uds-13-05-ubuntus-second-online-developer-summit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Building an Ubuntu SDK App: rev 1</title>
		<link>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-1/</link>
		<comments>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-1/#comments</comments>
		<pubDate>Mon, 08 Apr 2013 09:00:14 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[building-sdk-app-series]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1570</guid>
		<description><![CDATA[This is going to be the first in a series of articles about my journey into the wonderful world of Ubuntu SDK app development.  I&#8217;m no stranger to programming, or even app development on Ubuntu, but I am a stranger &#8230; <a href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is going to be the first in a series of articles about my journey into the wonderful world of <a href="http://developer.ubuntu.com/get-started/gomobile/" target="_blank">Ubuntu SDK app development</a>.  I&#8217;m no stranger to programming, or even app development on Ubuntu, but I am a stranger to Qt and QML.  Or at least I was.</p>
<h2>Why build a Reddit client?</h2>
<p>I started <a href="https://code.launchpad.net/~mhall119/+junk/uReadIt" target="_blank">uReadIt</a> for two primary reasons:</p>
<ol>
<li>I missed browsing Reddit in bed from my Nexus 7 (/r/science/ is nice when the &#8220;educational&#8221; channels in the US are playing crap), which I could do when it was running Android.  But even more importantly&#8230;</li>
<li>I wanted to learn to write apps using the new Ubuntu SDK, and I always learn best by building something real.</li>
</ol>
<p>The first of these was remarkably easy, I has a way of browsing my favorite subreddits within a day.  It&#8217;s the second reason, now, that is driving this development.  That&#8217;s important to remember, because it means I may choose to add features so that I can learn a part of the SDK, not necessarily because it&#8217;s an overly useful feature.  It also means I probably won&#8217;t be adding features that would make for an awesome Reddit app, unless they provide a way for me to try something new.</p>
<h2>Tabs or PageStack?  That is the question</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/QtCreator_UbuntuTemplates.png"><img class="alignright size-medium wp-image-1573" title="QtCreator_UbuntuTemplates" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/QtCreator_UbuntuTemplates-300x186.png" alt="" width="300" height="186" /></a>The Ubuntu SDK uses QtCreator, and adds plugins for integration with Ubuntu Devices, the Ubuntu Components, and also a set of Ubuntu App templates.  The QML templates both use the Ubuntu <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-mainview.html" target="_blank">MainView</a> component as it&#8217;s top-level element, but where they immediately differ is on the second-level components used for managing multiple &#8220;pages&#8221; in your app.</p>
<p>The first option is <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-tabs.html" target="_blank">Tabs</a>, which allows the user to switch between pages using an Ubuntu-themed tab-bar at the top.  This is what the Core Apps are using, and also what is used by default apps included in the Ubuntu Touch devices images, such as the Phone and Gallery apps.  Tabs are an easy way to provide flat navigation that the user can switch between any time.</p>
<p>The second option uses the <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components0-pagestack.html" target="_blank">PageStack</a> component, which as the name implies manages a stack of pages.  PageStack doesn&#8217;t give you automatic navigation like Tabs do, you have to write the code to push pages to the stack (such as onClicked event handlers on a ListView itemm more on that later).  But it will automatically put a &#8220;Back&#8221; toolbar button in the bottom toolbar for you when when you push more than one page onto the stack, and clicking that will bring the user to the previous page in the stack.</p>
<p>I started out with Tabs, but decided that PageStack made more sense for what I wanted.</p>
<h2>Putting it all together</h2>
<p>So, to get started I created a new project in QtCreator, using the <strong>Ubuntu UI &#8211; Simple</strong> template (this is the PageStack one).  This gave me MainView, PageStack, and a single Page components in my uReadIt.qml file.  I knew I wanted the first page to be my subreddit list of articles, so I gave it an id of &#8220;subreddits&#8221;.  Next I created a second page and called it &#8220;articleView&#8221;, which is where I would load the actual article.  I gave each page a title, which the PageStack and MainView components automatically used to produce a large text header for my app.</p>
<pre>MainView {
    // objectName for functional testing purposes (autopilot-qt5)
    objectName: "mainView"
    applicationName: "uReadIt"
    id: window

    width: units.gu(50)
    height: units.gu(75)

    PageStack {
        id: pageStack
        anchors.fill: parent
        Component.onCompleted: pageStack.push(subreddits)

        Page {
            id: subreddits
            anchors.fill: parent
            title: 'uReadIt'
        }

        Page {
            id: articleView
            title: 'Article'
        }
    }
}</pre>
<p>Next I added a <a href="http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-listview.html" target="_blank">ListView</a> component to the first page, which I knew I needed for my list of articles.  Getting data into a ListView is simply a matter of giving it a ListModel instance.  And while Qt provides a very feature-full <a href="http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick-xmllistmodel2-xmllistmodel.html" target="_blank">XMLListModel</a>, Reddit&#8217;s API uses JSON.  Fortunately there JSONListModel implementation readily available on the internet, and I quickly found one on GitHub by <a href="https://github.com/kromain/qml-utils" target="_blank">Romain Pokrzywka</a> that fit the bill nicely.  All I needed to do was give it the <a href="http://www.reddit.com/dev/api#GET_hot" target="_blank">Reddit API URL</a> for a subreddit, a json path query for pulling out just the article data, and it was ready to go.</p>
<pre>Page {
    id: subreddits
    anchors.fill: parent
    title: 'uReadIt'

    ListView {
        id: articleList
        ...
        JSON.JSONListModel {
            id: subredditFeed
            source: "http://www.reddit.com/r/Ubuntu/hot.json"

            query: "$.data.children[*]"
        }
        model: subredditFeed.model

    }
}</pre>
<p>To display the JSON data in the ListView, I needed to give it a &#8220;delegate&#8221; component, which QML will use as a kind of template for building an component item for each data item in the ListModel.  I opted for the <a href="http://developer.ubuntu.com/api/ubuntu-12.10/qml/mobile/qml-ubuntu-components-listitems0-subtitled.html" target="_blank">ListItem.Subtitled</a> provided by the Ubuntu SDK Components, which would allow me to give the article title as the primary text, and the article&#8217;s Reddit score as a sub-text. By settings <em>progression</em> to true, it even added an indicator arrow to inform the user that clicking on it will take them somewhere else. Finally I set the item&#8217;s onClicked callback handler to push the <em>articleView</em> page to the top of the PageStack, which will switch the user to that page, and provide a &#8220;Back&#8221; toolbar button to return the user to the <em>subreddits</em> page.</p>
<pre>    ListView {
        id: articleList
        ...
        delegate: ListItem.Subtitled {
            text: model.data.title
            subText: 'Score: ' + model.data.score
            progression: true
            onClicked: pageStack.push(articleView)
        }
    }</pre>
<p>&nbsp;</p>
<p><code></code><br />
<a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev1.png"><img class="alignright size-medium wp-image-1575" title="rev1" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/rev1-191x300.png" alt="" width="191" height="300" /></a>That&#8217;s all I needed!  QML even took care of kicking off the HTTP request to the Reddit API as soon as the app starts.  My previous GUI programming experience is with python/Gtk and Java/Swing, which are both very verbose, very explicit toolkits.  QML is almost magical, by comparison, and it did take me a while to adjust and become comfortable with it &#8220;just working&#8221; the way it should, without me having to tell it.</p>
<h2 style="clear: both;">Next Time: Content!</h2>
<p>With that, I committed <a href="http://bazaar.launchpad.net/~mhall119/+junk/uReadIt/revision/1" target="_blank">revision 1</a> to my Bazaar branch.  I had a working article list being pulled from Reddit.  In my next post, I&#8217;ll be covering how I got it to display the actual content of the article in the <em>articleView</em> page.</p>
<p><a title="Building an Ubuntu SDK App: rev 2" href="http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-2/">Read the next article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/building-an-ubuntu-sdk-app-rev-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Core Apps: Road to October</title>
		<link>http://mhall119.com/2013/04/core-apps-road-to-october/</link>
		<comments>http://mhall119.com/2013/04/core-apps-road-to-october/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 16:59:55 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1559</guid>
		<description><![CDATA[Shortly after announcing the Ubuntu Phone, we made an ambitious and frankly unprecedented decision to make the development of the phone&#8217;s core apps a community initiative.  We weren&#8217;t just open sourcing the apps being developed by Canonical (though we did &#8230; <a href="http://mhall119.com/2013/04/core-apps-road-to-october/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Shortly after announcing the Ubuntu Phone, we made an ambitious and frankly unprecedented decision to make the development of the phone&#8217;s <a href="https://wiki.ubuntu.com/Touch/CoreApps" target="_blank">core apps</a> a community initiative.  We weren&#8217;t just open sourcing the apps being developed by Canonical (though we did that too), we would let the community drive the design and development of what would become the foundation of the Ubuntu Touch app ecosystem.  And we would do it ten short months.<span id="more-1559"></span></p>
<h2>Work Item Tracking</h2>
<p>Building 11 apps in less than a year is a lot of work, and tracking that work is itself a lot of work.  To do this, we are using the same tools and process as the rest of Ubuntu&#8217;s development.  This means using Launchpad for code hosting and bug tracking.  But more importantly, it also means using <a title="Core Apps Blueprints" href="https://blueprints.launchpad.net/ubuntu-phone-commons/" target="_blank">Blueprints</a> for planning, breaking the work into individual tasks, and assigning those tasks to individual contributors.  This also allows us to use the <a title="Core Apps Charts" href="http://status.ubuntu.com/coreapps-13.10/" target="_blank">Ubuntu Status Tracker</a> to view the progress being made on those tasks.  As of right now, that chart looks like this:</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_burndown.png"><img class="alignnone size-full wp-image-1560" title="coreapps_burndown" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_burndown.png" alt="" width="843" height="434" /></a></p>
<p>As you can see, when we started tracking them we had about 165 work items defined, and about 140 left to finish.  As tasks are completed, and the developer updates the Blueprint with the new status of the work item, the orange part of the chart will shrink, and the green part will grow.  If we can keep the green part on or below the black line, then we&#8217;re on track to finish them all by our October goal.</p>
<h2>Milestones</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_milestones.png"><img class="alignright size-full wp-image-1562" title="coreapps_milestones" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_milestones.png" alt="" width="303" height="420" /></a>Ten months is a short amount of time to build a collection of well designed and polished apps, but it&#8217;s also a very long time for planning development work.  In order to narrow our focus and concentrate on immediate development tasks, we&#8217;ve further broken down the development period into a <a title="Core Apps Milestone Charts" href="http://status.ubuntu.com/coreapps-13.10/milestones.html" target="_blank">number of milestones</a>, one for every month between now and October.</p>
<p>So instead of planning out the entire cycle, we will be scheduling tasks on a monthly basis.  This will make the amount of work seem less daunting, and also give us a more agile cycle of planning, development, and evaluation.  Each milestones will in turn get it&#8217;s own burn-down chart, so we can track the progress being made within the month as well.</p>
<h2>Development Teams</h2>
<p>Work items are also <a title="Core Apps Team Charts" href="http://status.ubuntu.com/coreapps-13.10/teams.html" target="_blank">separated by team</a>, which allows us to track the progress of individual projects, as well as the overall projects of the core apps campaign.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_clockchart.png"><img class="alignright size-full wp-image-1563" title="coreapps_clockchart" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_clockchart.png" alt="" width="854" height="530" /></a></p>
<p>This allows teams to easily check if they are on track to complete their project  by October, and also gives them an idea of how much (or how little) work remains to be done.</p>
<h2>Next Steps</h2>
<p>The first milestone, <a title="Core Apps Month 0" href="http://status.ubuntu.com/coreapps-13.10/all-coreapps-13.10-month-0.html" target="_blank">coreapps-13.10-month-0</a> is coming up in mid-April.  For this milestone, we have been scheduling work items that were already making good progress, or that were small enough they could be completed in the two weeks between when it was defined and when it ends.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_month0.png"><img class="alignright size-full wp-image-1565" title="coreapps_month0" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_month0.png" alt="" width="841" height="434" /></a></p>
<p>The milestone after that, <a title="Core Apps Month 1" href="http://status.ubuntu.com/coreapps-13.10/all-coreapps-13.10-month-1.html" target="_blank">ubuntu-13.10-month-1</a>, ends mid-May, and will be our target for an alpha-level release of most of the apps.  As you can see, there is still a lot of work to be done between now and then, but we are currently below the burn-down line, so as long as we keep the momentum going we will make that goal.</p>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_month1.png"><img class="alignright size-full wp-image-1566" title="coreapps_month1" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/04/coreapps_month1.png" alt="" width="840" height="435" /></a></p>
<p>Everything not currently scheduled for one of these two milestones is targeted to the final October goal.  Sometime in May we will begin scheduling work items for the coreapps-13.10-month-2 milestone, based on the progress made on these first two miles.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/04/core-apps-road-to-october/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 3/5 queries in 0.001 seconds using disk: basic
Object Caching 691/691 objects using disk: basic

Served from: mhall119.com @ 2013-05-23 20:55:25 -->