<?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; canonical</title>
	<atom:link href="http://mhall119.com/tag/canonical/feed/" rel="self" type="application/rss+xml" />
	<link>http://mhall119.com</link>
	<description>Random thoughts on programming, science and politics</description>
	<lastBuildDate>Mon, 17 Jun 2013 19:41:19 +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>Core Apps Update: Calculator</title>
		<link>http://mhall119.com/2013/06/core-apps-update-calculator/</link>
		<comments>http://mhall119.com/2013/06/core-apps-update-calculator/#comments</comments>
		<pubDate>Thu, 06 Jun 2013 08:00:57 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[coreapps]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1747</guid>
		<description><![CDATA[This is my third Core Apps update, you can go back and read about the Clock and Calendar apps if you missed them.  Today I&#8217;m going to show off the Calculator app. Calculator Features Basic Functions The Calculator does exactly &#8230; <a href="http://mhall119.com/2013/06/core-apps-update-calculator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is my third Core Apps update, you can go back and read about the <a title="Core Apps Update: Clock" href="http://mhall119.com/2013/06/core-apps-update-clock/" target="_blank">Clock</a> and <a title="Core Apps Update: Calendar" href="http://mhall119.com/2013/06/core-apps-update-calendar/" target="_blank">Calendar</a> apps if you missed them.  Today I&#8217;m going to show off the Calculator app.</p>
<h1>Calculator Features</h1>
<h2>Basic Functions</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_empty1.png"><img class="alignleft size-medium wp-image-1771" title="calculator_empty" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_empty1-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_entry1.png"><img class="alignleft size-medium wp-image-1772" title="calculator_entry" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_entry1-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_tearoff1.png"><img class="alignleft size-medium wp-image-1773" title="calculator_tearoff" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_tearoff1-187x300.png" alt="" width="187" height="300" /></a></p>
<p style="clear: both;">The Calculator does exactly what you would expect a calculator to do.  It&#8217;s a four-function calculator and does it&#8217;s job perfectly well.  But it has a few unique features that make it so much more useful.  Using the old paper-roll calculators as inspiration, the calculator lets you label the numbers in your calculation, so you can go back and see &#8220;7 what?&#8221;.  When you&#8217;re done with a calculation, instead of clearing it off, you simply drag upwards to &#8220;tear off&#8221; that individual calculation.</p>
<h2>Calculation History</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_tornoff1.png"><img class="alignleft size-medium wp-image-1774" title="calculator_tornoff" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_tornoff1-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_history.png"><img class="alignleft size-medium wp-image-1775" title="calculator_history" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_history-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_delete.png"><img class="alignleft size-medium wp-image-1776" title="calculator_delete" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_delete-187x300.png" alt="" width="187" height="300" /></a></p>
<p style="clear: both;">Just because you&#8217;ve torn off a calculation, doesn&#8217;t mean you&#8217;ve thrown it away.  Instead, your calculation is stored in a browseable history.  This makes the labels even more useful, because you can go back hours, days, even months to an old bit of calculating.  You can even tap on any number in any of those calculations to insert it into your current one.  If you really are done with a calculation, you can swipe it to the right or left to delete it from your history.</p>
<h1>Visual Designs</h1>
<p style="clear: both;">The Design team says we&#8217;ll have visual designs for the Calculator later this week, so the developers will be able to start on implementing those.  Keep an eye on the <a href="http://design.canonical.com/" target="_blank">design team blog</a> and Google+ to see them when they come out.</p>
<h1>Release Schedule</h1>
<p><a href="https://wiki.ubuntu.com/Touch/CoreApps/Calculator#Release_Schedule" target="_blank"><img class="alignleft size-medium wp-image-1753" title="calculator_schedule" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calculator_schedule-300x171.png" alt="" width="300" height="171" /></a></p>
<p style="clear: both;">The <a href="https://wiki.ubuntu.com/Touch/CoreApps/Calculator#Release_Schedule" target="_blank">release schedule</a> for the Calculator is the same as the Clock.  It&#8217;s already well past what would be considered an Alpha release, so we just called May for that milestone.  Going forward, we plan on delivering a Beta in July that includes the visual designs, followed by a final release in August.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/06/core-apps-update-calculator/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Core Apps Update: Calendar</title>
		<link>http://mhall119.com/2013/06/core-apps-update-calendar/</link>
		<comments>http://mhall119.com/2013/06/core-apps-update-calendar/#comments</comments>
		<pubDate>Wed, 05 Jun 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[canonical]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[coreapps]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1755</guid>
		<description><![CDATA[Yesterday I posted the first in a new series of Core App Update, featuring the Clock App&#8217;s development.  Today I&#8217;m going to cover the status of the Calendar Calendar Features Calendar View The calendar now provides several different views you can choose &#8230; <a href="http://mhall119.com/2013/06/core-apps-update-calendar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday <a title="Core Apps Update: Clock" href="http://mhall119.com/2013/06/core-apps-update-clock/">I posted</a> the first in a new series of Core App Update, featuring the Clock App&#8217;s development.  Today I&#8217;m going to cover the status of the <a href="https://wiki.ubuntu.com/Touch/CoreApps/Calendar" target="_blank">Calendar</a></p>
<h1>Calendar Features</h1>
<h2>Calendar View</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_today.png"><img class="alignleft size-medium wp-image-1756" title="calendar_today" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_today-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_condensed.png"><img class="alignleft size-medium wp-image-1757" title="calendar_condensed" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_condensed-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_timeline.png"><img class="alignleft size-medium wp-image-1758" title="calendar_timeline" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_timeline-187x300.png" alt="" width="187" height="300" /></a></p>
<p style="clear: both;">The calendar now provides several different views you can choose from.  You start off with a full month at the top, and your events for the day below.  Swiping left and right on the month will take you back or forward a month at a time.  Swiping left or right on the bottom half will take you back and forward a day at a time.</p>
<p style="clear: both;">Pull the event area down and let it go, and the month will collapse down into a single week. Now swiping left and right there will move you back and forward a week at a time.  Pull down and let it go again and it will snap back to showing the full month.</p>
<p style="clear: both;">Finally, you have an option in the toolbar (swipe up from the bottom edge) to switch from an event list to a timeline view of your events.</p>
<h2>Adding Events</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_addevent.png"><img class="alignleft size-medium wp-image-1759" title="calendar_addevent" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_addevent-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_withevent.png"><img class="alignleft size-medium wp-image-1760" title="calendar_withevent" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_withevent-187x300.png" alt="" width="187" height="300" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_viewevent.png"><img class="alignleft size-medium wp-image-1761" title="calendar_viewevent" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_viewevent-187x300.png" alt="" width="187" height="300" /></a></p>
<p style="clear: both;">You can current add events to the calendar app, and they will be stored in a local database.  However, after discussions with Ubuntu Touch developers, the Calendar team is refactoring the app to use the <a href="http://qt-project.org/wiki/Organizer_API" target="_blank">Qt Organizer</a> APIs instead.  This will allow it to automatically support saving to <a href="http://projects.gnome.org/evolution/arch.shtml" target="_blank">Evolution Data Server</a> as a backend as soon as it&#8217;s integrated, making calendar events available to other parts of Ubuntu such as the datetime indicator.  Being able to import your ical feeds is also on the developer&#8217;s<a href="https://blueprints.launchpad.net/ubuntu-phone-commons/+spec/initial-calendar-development"> TODO list</a>.</p>
<h1 style="clear: both;">Visual Designs</h1>
<p>We don&#8217;t have new visual designs for the Calendar yet, but it is one of the apps that the Design team has committed to providing one for.  Now that they are done with the Clock&#8217;s visual designs, I hope to see these soon for the Calendar.</p>
<h1>Release Schedule</h1>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_schedule.png"><img class="alignleft size-medium wp-image-1762" title="calendar_schedule" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/calendar_schedule-300x171.png" alt="" width="300" height="171" /></a></p>
<p style="clear: both;">Once again I worked with the Calendar developers to set <a href="https://wiki.ubuntu.com/Touch/CoreApps/Calendar#Release_Schedule" target="_blank">release targets</a> for their app.  The alpha release is targeted for month-2, this month, and should include the switch to Qt Organizer.  Then we plan on having a Beta release in August and a Final in September.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/06/core-apps-update-calendar/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Core Apps Update: Clock</title>
		<link>http://mhall119.com/2013/06/core-apps-update-clock/</link>
		<comments>http://mhall119.com/2013/06/core-apps-update-clock/#comments</comments>
		<pubDate>Tue, 04 Jun 2013 09:00:42 +0000</pubDate>
		<dc:creator>Michael Hall</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[application-development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[coreapps]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://mhall119.com/?p=1712</guid>
		<description><![CDATA[The Ubuntu Touch Core Apps project is a new kind of collaboration between Canonical and the wider Ubuntu community, with a goal of developing high-quality applications for Ubuntu Touch. A couple of months ago I set out the Core Apps &#8230; <a href="http://mhall119.com/2013/06/core-apps-update-clock/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The<a href="https://wiki.ubuntu.com/Touch/CoreApps" target="_blank"> Ubuntu Touch Core Apps</a> project is a new kind of collaboration between Canonical and the wider Ubuntu community, with a goal of developing high-quality applications for Ubuntu Touch. A couple of months ago I set out the Core Apps <a title="Core Apps: Road to October" href="http://mhall119.com/2013/04/core-apps-road-to-october/">roadmap to October</a>, and it&#8217;s high time I got around to giving you an update on our progress.</p>
<p>I had originally planned on giving an update of each of the core apps in a single blog post, but I realized that was going to get very, very long.  And nobody has time to read a giant wall of text.  So instead I&#8217;ll be breaking them up, one post per apps, so you can spread your reading time over multiple days.</p>
<p>To kick this off, here are the latest developments going on in the Clock app:</p>
<h1>Clock Features</h1>
<h2>Sunrise &amp; Sunset</h2>
<h3 style="clear: both;"><a style="font-size: 16px;" href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_now.png"><img class="alignleft size-thumbnail wp-image-1715" title="clock_now" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_now-150x150.png" alt="" width="150" height="150" /></a></h3>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_sunrise.png"><img class="size-thumbnail wp-image-1716 alignleft" title="clock_sunrise" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_sunrise-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/clock_addlocation.png"><img class="alignleft size-thumbnail wp-image-1733" title="clock_addlocation" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/clock_addlocation-150x150.png" alt="" width="150" height="150" /></a></p>
<p style="clear: both;">Recently added to the main Clock tab is a way to check the sunrise and sunset times for the day.  Simply tap on the clock face and it will switch to the sunrise/sunset view.  Tap it again to switch back.  Swipe up from the bottom to reveal the toolbar, where you can set your location (which is used to calculate your specific sunrise and sunset times).</p>
<h2 style="clear: both;">Alarms</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_addalarm.png"><img class="alignleft size-thumbnail wp-image-1717" style="clear: both;" title="clock_addalarm" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_addalarm-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_withalarm.png"><img class="alignleft size-thumbnail wp-image-1718" title="clock_withalarm" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_withalarm-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_savedalarms.png"><img class="alignleft size-thumbnail wp-image-1719" title="clock_savedalarms" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_savedalarms-150x150.png" alt="" width="150" height="150" /></a></p>
<p style="clear: both;">The Clock app developers are still waiting on a <a href="http://summit.ubuntu.com/uds-1305/meeting/21763/client-1305-background-task-service/" target="_blank">platform API</a> to support registering alarms that will work even when the Clock app isn&#8217;t running.  But while they&#8217;re waiting on that, they&#8217;ve still be working hard on the interface for managing your alarms.  Their approach is both minimal and obvious, you drag the hour and minute hands around to the time you and and click Done in the center.  If you need more options, you can pick how often to repeat, what alarm tone to use, and whether or not to vibrate.</p>
<p style="clear: both;">Now these won&#8217;t actually work until the platform API is in place, but you can already see how it will look to the user, and how simple it is to do.</p>
<h2 style="clear: both;">Timer</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timer.png"><img class="alignleft size-thumbnail wp-image-1720" style="clear: both;" title="clock_timer" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timer-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerrun.png"><img class="alignleft size-thumbnail wp-image-1721" title="clock_timerrun" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerrun-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerdone.png"><img class="alignleft size-thumbnail wp-image-1722" title="clock_timerdone" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerdone-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerset.png"><img class="alignleft size-thumbnail wp-image-1723" title="clock_timerset" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerset-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerpresets.png"><img class="alignleft size-thumbnail wp-image-1724" title="clock_timerpresets" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_timerpresets-150x150.png" alt="" width="150" height="150" /></a></p>
<p style="clear: both;">Like the alarms, setting a timer is both minimal and obvious.  Unlike alarms, the timer is working today.  Drag the hand around to set how many seconds, tap the minutes part of the time and drag the hand to set the minutes.  Make more than one revolution around the dial and it will start adding hours as well.</p>
<p style="clear: both;">Another nice feature is the ability to define custom timers that you can use again and again.  Swipe up from the bottom to reveal the toolbar again, select Add Preset, and set the duration using the same simple dragging motions on the dial.</p>
<h2 style="clear: both;">Stopwatch</h2>
<p><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatch.png"><img class="alignleft size-thumbnail wp-image-1726" title="clock_stopwatch" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatch-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchrun.png"><img class="alignleft size-thumbnail wp-image-1727" title="clock_stopwatchrun" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchrun-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchlap.png"><img class="alignleft size-thumbnail wp-image-1728" title="clock_stopwatchlap" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchlap-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchstop.png"><img class="alignleft size-thumbnail wp-image-1729" title="clock_stopwatchstop" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchstop-150x150.png" alt="" width="150" height="150" /></a><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchlaps.png"><img class="alignleft size-thumbnail wp-image-1730" title="clock_stopwatchlaps" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/05/clock_stopwatchlaps-150x150.png" alt="" width="150" height="150" /></a></p>
<p style="clear: both;">Finally we come to the stopwatch part of the app.  In addition to simple start, pause and reset functionality, the stopwatch lets you mark laps as it goes, and keeps a log of each one that you can view both while the stopwatch is running and after.</p>
<h1 style="clear: both;">Visual Designs</h1>
<p style="clear: both;"><a href="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/clock_app_design.jpg"><img class="alignnone size-medium wp-image-1737" title="clock_app_design" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/clock_app_design-300x191.jpg" alt="" width="300" height="191" /></a></p>
<p style="clear: both;">Some of you may have seen the new visual concepts that the Design Team <a href="http://design.canonical.com/2013/05/35908/" target="_blank">published last month</a>, which received quite a bit of positive feedback.  Well this week they sent the Clock developers the <a href="https://code.launchpad.net/~jounihelminen/ubuntu-clock-app/designs/" target="_blank">completed visual designs</a> for the Clock app, so we should start to get our first taste of those designs in action in the next few weeks.</p>
<h1 style="clear: both;">Release Schedule</h1>
<p><a href="https://wiki.ubuntu.com/Touch/CoreApps/Clock#Release_Schedule"><img class="alignnone size-medium wp-image-1738" title="clock_schedule" src="http://blog_uploads.s3.amazonaws.com/wp-content/uploads/2013/06/clock_schedule-300x169.png" alt="" width="300" height="169" /></a></p>
<p>Starting a couple of weeks ago, I started working with each of the Core Apps developer teams to set <a href="https://wiki.ubuntu.com/Touch/CoreApps/Clock#Release_Schedule" target="_blank">release targets</a> for Alpha, Beta and Final releases of the app, with a goal to have them all at a 1.0 version before the October release of Ubuntu 13.10.  For the clock, we decided to mark the month-1 milestone (May) as an alpha release, because of the progress they had already made.  We then picked month-3 (July) for beta and month-4 (August) for our final release target.  Furthermore we have work items assigned on a monthly release basis to <a href="http://status.ubuntu.com/coreapps-13.10/ubuntu-clock-dev.html" target="_blank">track the progress</a> we are making.</p>
]]></content:encoded>
			<wfw:commentRss>http://mhall119.com/2013/06/core-apps-update-clock/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<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>2</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>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 1/13 queries in 0.006 seconds using disk: basic
Object Caching 714/731 objects using disk: basic

Served from: mhall119.com @ 2013-06-18 02:49:48 -->