<?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>Mark Kirby - Mobile Developer</title>
	<atom:link href="http://mark-kirby.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://mark-kirby.co.uk</link>
	<description>I'm a user focused mobile developer, here is where I publish advice and thoughts on building great mobile apps</description>
	<lastBuildDate>Tue, 12 Jan 2010 14:30:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash on Devices book review</title>
		<link>http://mark-kirby.co.uk/2010/flash-on-devices-book-review/</link>
		<comments>http://mark-kirby.co.uk/2010/flash-on-devices-book-review/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 14:26:31 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=608</guid>
		<description><![CDATA[Here&#8217;s a quick review of the book &#8220;AdvancED Flash on Devices&#8221; by Elad Elrom, Scott Janousek and Thomas Joos, published at Friends of ED. In a nutshell, if you work with Flash and mobile, you must buy it.

For the past few months I&#8217;ve been working on a Flash Lite project, and 3 months ago I [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick review of the book &#8220;AdvancED Flash on Devices&#8221; by Elad Elrom, Scott Janousek and Thomas Joos, published at <a href="http://www.friendsofed.com/book.html?isbn=1430219041">Friends of ED</a>. In a nutshell, if you work with Flash and mobile, you must buy it.</p>
<p><img class="alignnone size-full wp-image-610" title="AdvancED Flash on Devices" src="http://mark-kirby.co.uk/wp-content/uploads/2010/01/9781430219040.jpg" alt="AdvancED Flash on Devices" width="200" height="240" /></p>
<p>For the past few months I&#8217;ve been working on a Flash Lite project, and 3 months ago I acquired a copy of AdvancED Flash On Devices. Before this book my main point of reference for any questions on the Flash Lite ecosystem was random mutterings here and there on various Flash blogs, or the constantly changing and always over cluttered Adobe pages. To be frank though, very few people seem to talk about Flash Lite at all, including Adobe.</p>
<p>Topics on Flash Lite in the book include details on devices which run Flash Lite, different versions of Flash Lite and their differences, quirks and bugs, framworks others have made, third party tools and more. The only thing it won&#8217;t tell you is how to code Flash Lite apps in any detail, but there are already plenty of books on Flash and Actionscript 2, and the classes available on Flash Lite are well covered in Adobe&#8217;s technical documentation.</p>
<p>Importantly there are also chapters on the future for Flash on Mobile, including getting Flash apps onto the iPhone and Flash 10 for mobile.</p>
<p>Since development of Flash Lite has stopped, you can also be sure that this book contains a summary of Flash Lite as it ended, and therefore will not go out of date (although you will have to know to ignore any 3.1 information). If you find yourself working on a Flash Lite project a year from now targeting devices which aren&#8217;t compatible with the new Flash 10 for mobile, this book should still serve you as well as it does today.</p>
<p>An essential purchase for anyone looking for a comprehensive overview of the complex world of Flash on mobile.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2010/flash-on-devices-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heroes of the mobile screen review</title>
		<link>http://mark-kirby.co.uk/2009/heroes-of-the-mobile-screen-review/</link>
		<comments>http://mark-kirby.co.uk/2009/heroes-of-the-mobile-screen-review/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 16:18:51 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=603</guid>
		<description><![CDATA[Yesterday I attended the Heroes of the Mobile Screen conference at the BFI Southbank. This was a conference with a focus on business and strategy within the mobile industry. Here are my thoughts on the day.

Teenage panel
The undisputed highlight of the day was the teenage dragons den panel organised by Julia Shalet of the Digital [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I attended the <a href="http://www.mobileheroes.net/">Heroes of the Mobile Screen</a> conference at the BFI Southbank. This was a conference with a focus on business and strategy within the mobile industry. Here are my thoughts on the day.</p>
<p><img class="alignnone size-medium wp-image-604" title="logo_building" src="http://mark-kirby.co.uk/wp-content/uploads/2009/12/logo_building-300x152.png" alt="logo_building" width="300" height="152" /></p>
<h2>Teenage panel</h2>
<p>The undisputed highlight of the day was the teenage dragons den panel organised by <a href="http://twitter.com/jewl">Julia Shalet</a> of the <a href="http://digitalyouth.ischool.berkeley.edu/">Digital Youth Project</a>. During this segment, various startups pitched their idea to a group of six teenagers aged 16 &#8211; 18 who gave them feedback and asked questions.</p>
<p>What was most interesting about this segment to me was not so much the fact that these were younger people, but that the stage was given to non-industry people. Listening to &#8216;normal&#8217; people give their views on apps, how they use their phones and what they want from their services was a real eye-opener and its something the industry should be doing a lot more of. As one panel member stated, app&#8217;s and iphones are what &#8216;you lot&#8217; (us, the audience) are interested in, not your average teenager (or I&#8217;d imagine your average person in general).</p>
<p>Points that surprised/interested me:</p>
<ul>
<li>All of the teenagers on stage used their phones for texting, and in the case of the 2 Blackberry owners, online messaging, and very little else</li>
<li>Most of the teenagers were happy to have &#8217;simple phones&#8217;, &#8216;just a Nokia&#8217; etc. One guy who did get a Blackberry said he preferred his N95 and wished he had just stuck with that</li>
<li>The teenagers were all keen on at least one of the mobile application ideas pitched to them &#8211; despite not having a phone that would be able to easily run those apps, nor really showing any strong keeness to upgrade</li>
</ul>
<p>It would have been nice to hear some more general views on mobile from the panel, but there is plenty of research available at the <a href="http://www.mobileyouth.org/">mobileYouth site</a> as introduced before the panel by Graham Brown.</p>
<p>As developers and startups, we shouldn&#8217;t assume we know what people want, and just develop for ourselves (i.e. fun iPhone and android apps, and business-like Blackberry apps). We could be missing out on a big alternative market.</p>
<h2>Other interesting topics</h2>
<p>Belinda Parmar from <a href="http://ladygeek.org.uk/">Ladygeek</a> made some interesting points about marketing to women. Not over simplifying, not offering too much choice and not simply going for pink versions were among the points mentioned. Like the teenagers, this talk showed that there are plenty of markets we might not even realise we are missing, and each should be carefully considered.</p>
<p>Douglas Richards and a group of VC&#8217;s spoke in the morning about getting funding. The key point seemed to be that app&#8217;s don&#8217;t make money, services do. Money is also to be made in providing the backbone that these app&#8217;s and services run on.</p>
<h2>Some constructive criticism</h2>
<p>Firstly well done to the team for putting on the first conference of its kind, the day went smoothly and seemed to go without a hitch, even managing to stay on schedule, and providing a lunch and some decent food throughout the day.</p>
<p>As with any conference, it wasn&#8217;t all perfection however. Sadly one panel was full of people promoting their companies individual offerings, and failing to discuss the topic at hand. Another descended into a discussion about social networks when the topic promised was on context and the user experience. There was also a distinct lack of true &#8216;heroes of the mobile screen&#8217;, although whether that is a bad thing is up for debate &#8211; we don&#8217;t need an Oscars of mobile just yet!</p>
<p>My advice for improvements for next time would be:</p>
<ul>
<li>Less pure business &#8211; a focus also on mobile design and user experience would produce more of a balance</li>
<li>Select energetic interesting speakers over those from a corporate background who are restricted in what they can say</li>
<li>Ensure those moderating the panels are able to do so properly &#8211; keeping the panellists focussed on the topic set</li>
<li>More full presentations &#8211; panels are often a bad idea, people can get dragged down rabbit holes and end up off topic. A solid presentation, by a published field expert, for at least 25 mins wins every time in my book. Think TED and dConstruct not SXSW.</li>
</ul>
<p>Let&#8217;s see what the team comes up with next year!</p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/heroes-of-the-mobile-screen-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using mobile apps for a better trip</title>
		<link>http://mark-kirby.co.uk/2009/using-mobile-apps-for-a-better-trip/</link>
		<comments>http://mark-kirby.co.uk/2009/using-mobile-apps-for-a-better-trip/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 15:53:34 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=587</guid>
		<description><![CDATA[I&#8217;ve just got back from a 2 week trip to North America, taking in Seattle, Vancouver and Portland. This is the first time I&#8217;ve really let loose with mobile apps on a trip, abandoning worries about data charges and using a range of iPhone apps. There is no doubt the trip was all the better [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just got back from a 2 week trip to North America, taking in Seattle, Vancouver and Portland. This is the first time I&#8217;ve really let loose with mobile apps on a trip, abandoning worries about data charges and using a range of iPhone apps. There is no doubt the trip was all the better for having these apps, and I thought I&#8217;d discuss how exactly they aided me and highlight the most useful ones.</p>
<p><a href="http://www.flickr.com/photos/fallenpegasus/3635380791/"><img class="alignnone size-full wp-image-590" title="3635380791_b043fd3e13" src="http://mark-kirby.co.uk/wp-content/uploads/2009/09/3635380791_b043fd3e13.jpg" alt="3635380791_b043fd3e13" width="400" height="300" /></a></p>
<p>I&#8217;ll go through each aspect of the trip mobile apps helped me with in turn, and then highlight specific apps, some apps span a few of these. I&#8217;m using an iPhone, 1st Gen (so no GPS nor compass).</p>
<h2>Local transport</h2>
<p>By far the best feature I was able to access on mobile was to figure out the local transport systems in the various cities.</p>
<h3>How I used to navigate local transport</h3>
<p>I used to find local transport a nightmare &#8211; I had no idea where any buses were going apart from the final destination, wouldn&#8217;t know which one to catch, which side of the road, where to get off &#8211; it was basically impossible. I&#8217;d either find one bus and use that, walking the rest of the way, or pay the extra for taxis, or even walk everywhere taking massive amounts of time and exhausting myself.</p>
<h3>Apps I used on this trip</h3>
<p>I downloaded a local bus app for each city &#8211; <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294531271&amp;mt=8">Seattle Metro</a> for Seattle and <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=289814055&amp;mt=8">PDX Bus</a> for Portland. However, both these had awkward interfaces and simply didn&#8217;t make navigating the buses any easier.</p>
<div id="attachment_594" class="wp-caption alignnone" style="width: 210px"><img class="size-medium wp-image-594" title="Seattle Metro" src="http://mark-kirby.co.uk/wp-content/uploads/2009/09/IMG_0403-200x300.PNG" alt="Seattle Metro screenshot" width="200" height="300" /><p class="wp-caption-text">Seattle Metro screenshot</p></div>
<p>Google Maps (installed by default on the iPhone) on the hand was a revelation, simple to understand and use, and it wasn&#8217;t even a dedicated bus app &#8211; it simply integrated perfectly with the other features of finding out where you were and where to go.</p>
<h3>How Google Maps public transport feature works</h3>
<p>You simply type in where you are, where you want to go and request a route by public transport. If you don&#8217;t know where you are you can use GPS or in our case triangulation, which is can pretty much locate you to within a small range in a large city.</p>
<div id="attachment_597" class="wp-caption alignnone" style="width: 210px"><img class="size-medium wp-image-597" title="Google Maps" src="http://mark-kirby.co.uk/wp-content/uploads/2009/09/IMG_0401-200x300.PNG" alt="Google Maps screenshot" width="200" height="300" /><p class="wp-caption-text">Google Maps screenshot</p></div>
<p>You then select the time you want to leave, and the app will walk you through the steps needed to reach the destination &#8211; how to get to the bus stop, what bus to catch, where to get off and how to reach your intended destination.</p>
<h3>Benefits &#8211; saving time and money</h3>
<p>This app enables you to take advantage of the same cheap transport benefits locals have (and in some cases gives you an advantage over locals). Before I would never have attempted to navigate the bus systems in a strange city, and if I did, I am sure I would have wasted a lot of time getting on the wrong bus or failing to take the fastest routes. You also save the money you may have had to spend on taxis.</p>
<p>There were places we simply could not have gone without this app, such as Kurt Cobains old house in the Lake Washington area of Seattle &#8211; there&#8217;s just one bus, every half hour, from a random location 10mins walk from our hotel. With Google Maps we got there within 30 mins of deciding to go, had a look, went for a quick walk somewhere else, used triangulation to roughly figure out where we were and got the next bus downtown.</p>
<h3>Problems encountered</h3>
<p>The app isn&#8217;t perfect, we did find some issues.</p>
<p>On Labor day (bank holiday Monday in the UK) the buses run on the Sunday schedules, but Google Maps didn&#8217;t know this, hence all the bus times were incorrect all day long. Once we figured out the problem we just used the app to locate bus stops and then read the times on the bus stop. In one case there were no times, so I used another app <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294531271&amp;mt=8">Seattle Metro</a>, to grab the latest times from the bus company.</p>
<p>Although it lists the nearest bus, if you miss it, it assumes you will want to wait for the next bus rather than walk somewhere else. There is no way of searching out alternative bus stops. At one point we found ourselves in a rough part of town having to wait 20 mins for the next bus. I didn&#8217;t want to run alternative searches on my phone. In the end we just walked down the road, and I kept checking for alternative buses as we moved along using the triangulation. Essentially we had to physically move to manipulate the data &#8211; a cumbersome input device for sure!</p>
<h2>Finding things to do and see</h2>
<p>There a number of apps dedicated to travel &#8211; locating bars and restaurants and finding stuff to do in the day. Some of these aren&#8217;t powered by the most trustworthy sources, so I tend to stick to guide books like Time Out, Lonely Planet and Rough Guides and do a quick sweep of websites before leaving.</p>
<p>This year I was able to put the Lonely Planet guides on my phone by downloading PDF&#8217;s of sections I was interested in from their website and putting them on the iPhone using the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=289943355&amp;mt=8">air sharing</a> app. Unfortunately it was almost unusable as the pdf&#8217;s take ages to scroll, always go back to the first page when you exit the app off and aren&#8217;t that easy to read on the small device.</p>
<p>Much better was <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=317165182&amp;mt=8">Lonely Planets Travel Guides</a> app which lets you download city guides for around £10 each. Overpriced certainly, and not the most usable, but still hands down the best option. Lighter and less touristy than getting out a book each time, and much better than the PDF&#8217;s. The main issue with the app was that the only way to view bars and restaurant was either using a near me feature which listed ones close to you at a given moment in time, or by accessing the map and clicking on random dots to see what was there. Another major flaw is resetting the app every time you load it. Not perfect by any means, but a good effort &#8211; I look forward to improved versions of this in future.</p>
<div id="attachment_598" class="wp-caption alignnone" style="width: 210px"><img class="size-medium wp-image-598" title="Lonely Planet guides screenshot" src="http://mark-kirby.co.uk/wp-content/uploads/2009/09/IMG_0404-200x300.PNG" alt="Lonely Planet guides screenshot" width="200" height="300" /><p class="wp-caption-text">Lonely Planet guides screenshot</p></div>
<h2>Other features</h2>
<p>I printed all my essential docs as pdfs and put them on the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=289943355&amp;mt=8">air sharing</a> app. This meant I could quickly check numbers and times without carrying round lots of paper or checking my mail each time.</p>
<p>Being able to access <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284882215&amp;mt=8">Facebook</a> in the park led me to arrange a meeting with an old friend who was only available that night, there is no doubt we would have otherwise missed each other as I had no time that day to go to an internet cafe (in fact, I didn&#8217;t even see any internet cafes).</p>
<p>Web access at anytime allowed me to check opening times for places, ensuring I didn&#8217;t go to the trouble of heading all the way to a gallery in Fremont which was closed.</p>
<p>Google Maps helped me to locate hard to find bars and cafe&#8217;s, the Seattle and Portland <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=313899511&amp;mt=8">Cocktail Compass</a> even told me which bars near me had happy hour on, and how long they had left!</p>
<h2>Final thought</h2>
<p>Apps like these don&#8217;t just add convenience to a holiday, or satisfy the urge to check your email every 5 mins (not something I actually did), they can actually change your entire trip. We saw and did far more on this trip than any other, traveling faster and cheaper than before on public transport, feeling less tired from walking around everywhere and knowing where and when to visit places. One could say this takes some of the fun out of traveling &#8211; the getting lost and finding your way. Personally, I feel getting lost is not something I (and especially not my girlfriend) actually finds as fun as it seems when it happens. It generally leads to wandering around desolate rough parts of towns, worried and stressed.</p>
<p>Whatever your view, there can be no doubt travel is being changed by mobile devices, and we are only at the beginning. Augmented reality here we come!</p>
<p>Image courtesy of <a href="http://www.flickr.com/photos/fallenpegasus/3635380791/">FallenPegasus</a> &#8211; <a rel="cc:attributionURL" href="http://www.flickr.com/photos/fallenpegasus/">http://www.flickr.com/photos/fallenpegasus/</a> / <a rel="license" href="http://creativecommons.org/licenses/by-nc/2.0/">CC BY-NC 2.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/using-mobile-apps-for-a-better-trip/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Comments are evil</title>
		<link>http://mark-kirby.co.uk/2009/comments-are-evil/</link>
		<comments>http://mark-kirby.co.uk/2009/comments-are-evil/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 12:10:24 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=583</guid>
		<description><![CDATA[I&#8217;ve just finished listening to an interesting episode of the Deep Fried Bytes podcast entitled in part &#8220;Why comments are evil&#8221;. In this episode the guest, Corey Haines (a traveling programmer living an interesting life which warrants discussion in itself), explains why he believes comments shouldn&#8217;t be the recommended practice they are often considered, and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished listening to an <a href="http://deepfriedbytes.com/podcast/episode-35-why-comments-are-evil-and-pair-programming-with-corey-haines/">interesting episode</a> of the <a href="http://deepfriedbytes.com/">Deep Fried Bytes podcast</a> entitled in part &#8220;Why comments are evil&#8221;. In this episode the guest, <a href="http://www.coreyhaines.com/">Corey Haines</a> (a traveling programmer <a href="http://programmingtour.blogspot.com/">living an interesting life</a> which warrants discussion in itself), explains why he believes comments shouldn&#8217;t be the recommended practice they are often considered, and can be easily abused. Here&#8217;s a quick summary of his reasoning:</p>
<p>Comments are often used to explain poorly written code</p>
<ul>
<li>If you need to explain your code by adding comments inside methods, the method is doing too many things and needs to be broken into smaller methods</li>
<li>The name of the method should accurately convey what the method is doing to a reader, no comments should be required</li>
</ul>
<p>Comments rot</p>
<ul>
<li>When code is updated, comments don&#8217;t always get updated alongside it</li>
<li>The comments end up lying about what the code is doing</li>
</ul>
<p>In summary:</p>
<ul>
<li>Write better code</li>
<li>Use highly descriptive method names and parameter names</li>
<li>Where you feel a comment is needed, instead take the time to rewrite and refactor the code to be more readable</li>
</ul>
<h2>My thoughts</h2>
<p>The timing of this couldn&#8217;t have been better for me. I&#8217;d spent the day working on the code for the <a href="/2009/optimising-visual-components-for-flash-mobile/">memory efficient data list</a> I discussed last week. I had just created 3 functions which each did around 8 different task, broken up by comments explaining what each did. Each task was only 3 &#8211; 6 lines of code, so it wasn&#8217;t an obscenely long method, but I still wasn&#8217;t sure whether to refactor or move on. After listening to the podcast I took their advice of never leaving this until later and refactored the next day.</p>
<p>The result:</p>
<ul>
<li>once the code had been refactored into different methods, I was able to see clearly where methods could be combined, reducing the amount of code</li>
<li>now I had more readable code, I realised some of these new methods really belonged in another class</li>
<li>so the code was shorter, easier to read, and the comments were gone</li>
<li>finally, I spotted a bug as it was now really exposed and obvious</li>
</ul>
<p>Now I plan to impose a new coding &#8216;rule&#8217; &#8211; no comments within methods.</p>
<p>What about comments above public methods, and at the head of classes? The podcast touched on these, saying you might want them for a framework, or for API documentation, although you shouldn&#8217;t use them in an auto doc style whereby you just replicate parameter names in comments. I have mixed thoughts on this. I agree that it seems pointless to describe well named methods and well named parameters twice, although it can be useful to detail restrictions on parameters for API documentation. I&#8217;d then like to use an automatic tool to produce this documentation to be kept from the code. Also descriptions at the head of certain classes can help explain where, when and how to use the class.</p>
<p>I guess my final thought is to use discretion.</p>
<p>Any thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/comments-are-evil/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Optimising visual components for Flash Mobile</title>
		<link>http://mark-kirby.co.uk/2009/optimising-visual-components-for-flash-mobile/</link>
		<comments>http://mark-kirby.co.uk/2009/optimising-visual-components-for-flash-mobile/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 16:03:34 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=574</guid>
		<description><![CDATA[I&#8217;ve been working on some a visual component for a flash mobile app, and thought I&#8217;d use it to give you a quick case study on how important it is to optimise everything for mobile. Although this example came from an app for Flash Mobile and Flash Lite, the same problem is suffered by iPhone [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on some a visual component for a flash mobile app, and thought I&#8217;d use it to give you a quick case study on how important it is to optimise everything for mobile. Although this example came from an app for Flash Mobile and Flash Lite, the same problem is suffered by iPhone devs, and anyone developing mobile content.</p>
<h2>The component &#8211; a list of data</h2>
<p>I&#8217;m trying create a list of data which can be navigated by pressing up and down on a nav pad. Each time you navigate, the next item in the list comes into view. You can only see one item at a time.</p>
<h2>The intensive option &#8211; a basic list</h2>
<p>The first time I did this, I created a long list of data, and showed the first item. Pressing up and down simply moved the list up and down as this diagram demonstrates:</p>
<p><img class="alignnone size-full wp-image-576" title="ComponentGrid - Intensive method" src="http://mark-kirby.co.uk/wp-content/uploads/2009/08/ComponentGrid-Intensive-method1.png" alt="ComponentGrid - Intensive method" width="375" height="423" /></p>
<p>There are a couple of issues with this:</p>
<ul>
<li> Its uses up a lot of memory as all the list items have to be attached to the stage from the beginning</li>
<li>You can&#8217;t have lists looping round, you can only go to each end</li>
</ul>
<h2>The improved option &#8211; reusing movieclips</h2>
<p>As the following diagram will hopefully explain, there is another way. You can have just 3 movieclips, and change the position and content of each as required. This saves memory as you only have 3 movieclips on the stage per component and you can loop round and round.</p>
<p><img class="alignnone size-full wp-image-580" title="ComponentGrid - good example" src="http://mark-kirby.co.uk/wp-content/uploads/2009/08/ComponentGrid-good-example1.png" alt="ComponentGrid - good example" width="427" height="690" /></p>
<p>Each coloured square represents one movieclip.</p>
<p>As you can see, this is relatively simple to implement and results in a much more efficient and flexible component. Any thoughts, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/optimising-visual-components-for-flash-mobile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Lite Components &#8211; an introduction</title>
		<link>http://mark-kirby.co.uk/2009/flash-lite-components-an-introduction/</link>
		<comments>http://mark-kirby.co.uk/2009/flash-lite-components-an-introduction/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 17:00:36 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=555</guid>
		<description><![CDATA[This article takes a look at Flash Lite Components &#8211; reusable controls and elements which you can drop into Flash Lite apps. I look at existing techniques, libraries and components as well as some tips on creating your own. My personal reason for this investigation is that at ribot we are working on some visual [...]]]></description>
			<content:encoded><![CDATA[<p>This article takes a look at Flash Lite Components &#8211; reusable controls and elements which you can drop into Flash Lite apps. I look at existing techniques, libraries and components as well as some tips on creating your own. My personal reason for this investigation is that at ribot we are working on some visual components for a little app we are creating, and I&#8217;d like to find some pointers on how we might be able to craft these in a reusable way. Hopefully you will learn something from this, and comment away at the end to feed back into the conversation.</p>
<p><a href="http://www.flickr.com/photos/joepemberton/"><img class="size-full wp-image-561   alignnone" title="Actionscript" src="http://mark-kirby.co.uk/wp-content/uploads/2009/08/2530021664_357b6699b0.jpg" alt="Actionscript" width="360" height="270" /></a></p>
<h2>What existing Flash Lite components are available?</h2>
<h3>Forum Nokia</h3>
<p>The latest high profile component release (actually around a year ago now) I could find was the <a href="http://www.forum.nokia.com/info/sw.nokia.com/id/d2336af2-0953-40a6-8dae-b80d368dead1/Adobe_Flash_Lite_2_x_Components_for_Mobile_Development.html">Forum Nokia Flash Lite Components</a> which include a button, popup dialog and scrollbar. Some of the components are skinable, they are flexible in terms of size. They appear easy to install and well documented. <a href="http://www.flashmobileblog.com/2008/07/19/flash-lite-11-and-flash-lite-20-components/">Adobe reported on these</a>, mentioning they were rather high in memory consumption &#8211; this is down to their flexibility and ease of use &#8211; there&#8217;s a price to pay for everything on mobile!</p>
<p>Forum Nokia then launched a competition this year which resulted in some <a href="http://wiki.forum.nokia.com/index.php/Mobile_Design_Challenge_part_2">winning Flash Lite Components</a> being developed. From that article you can download and play with a few other components. These all appear to follow the same structure as the components created by Nokia.</p>
<h3>Adobe examples</h3>
<p>The Flash Mobile blog has some <a href="http://www.flashmobileblog.com/examples/">Flash Lite UI Component Examples</a> which are intended for internal use only and aren&#8217;t documented. Apparently they are very lightweight, so could be a good example of how to develop components, and were developed by the Adobe team. Closer inspection reveals they aren&#8217;t especially flexible nor reusable. They are too lightweight! Yes they use less memory, but they haven&#8217;t taken into account the need for different sizes and purposes that the Nokia components have. <a href="http://www.flashmobileblog.com/examples/">The page that contains the examples</a> has some other great Flash Lite resources and is well worth further investigation.</p>
<h3>Shuriken Framwork</h3>
<p><a href="http://code.google.com/p/shurikencomponents/">Shuriken Components</a> is a framework for creating Flash Lite 2.x+ components, and is the work of one solo developer <a href="http://jessewarden.com/about">Jesse Warden</a>. These components are far more developer centric, resulting in a very light SWF file, with as many elements as possible drawn dynamically. This framework requires lots of developer input, and is closest in style to the framework we have been working on recently. My concern about this framework is it ties the presentation to the logic code too closely. As a resource its great if you want to go down the path of creating assets dynamically though, with plenty of code to play with and learn from. Sadly, there&#8217;s a lack of documentation (unless I missed it, feel free to chip in Jesse if you find this article).</p>
<h3>Conclusion</h3>
<p>So in summary, it looks like plenty of people have thought about making Flash Lite component libraries, but really only got to the stage where they were able to teach others how to make those libraries using their ideas. Not many people seem to have taken them up on this, but since we are looking to develop our own components anyway, this seems plenty to go on.</p>
<h2>Installing components</h2>
<h3>Installing components using MXP files</h3>
<p>The easiest components to install were those which used MXP files to manage the installation. These then run the Adobe Extension Manager which installs the following:</p>
<ul>
<li>Install .fla files containing the assets for the component into your default Flash components folder e.g &#8220;[INSTALL PATH]\Flash<br />
CS4\en\Configuration\Components\Forum Nokia&#8221;</li>
<li>Install class .as files containing the logic of the component into your default Flash classpath, e.g. &#8220;[INSTALL PATH]\Flash<br />
CS4\en\Configuration\Classes\com\forumnokia&#8221;</li>
</ul>
<p>To add components now, all you need to do is drag them from the components window inside Flash CS3/CS4 into your .fla for your app.</p>
<p>In the case of the forum nokia components, it wasn&#8217;t quite this simple, they required me to download an additional library and manually add it to the classes folder. It would have been great if the MXP file had done this for me. A point to consider when designing your own components I feel &#8211; make it as simple as possible to start using components as quickly as possible. If an automated feature doesn&#8217;t take care of the whole install process, the entire process may as well be manual, since the automation tricks you into thinking its taken care of everything.</p>
<h3>Installing components manually</h3>
<p>In the absence of an MXP file (neither Shuriken nor the Adobe components came with MXP&#8217;s) I found I had to open up the .fla file of the component, copy the component into the .fla for my app, and then copy the class into my classpath. It works, but it feels hacky and I&#8217;m sure there&#8217;s a better way &#8211; perhaps just by making an MXP myself.</p>
<h2>Creating and using components</h2>
<p>Forum Nokia produced their <a href="http://www.forum.nokia.com/info/sw.nokia.com/id/332b6e95-b173-4b58-8552-4639795212f9/Guide_to_Flash_Lite_Components.html">guide to using and creating Flash Lite Components</a> this June. This is an excellent guide and covers many of the topics I had planned to go into here. Read through it to learn how best to create and package your components for reuse. It covers topics I won&#8217;t go into here such as</p>
<ul>
<li>how to package MXP files, including custom icons and demos to display within the Flash IDE</li>
<li>how to enable parameters which can be edited from within the IDE using the component inspector</li>
<li>considerations when planning which features to include in your component</li>
</ul>
<h2>Skinning visual elements</h2>
<p>The Nokia components have been designed to make it apparently easy to customise the components. Within the fla file visual elements are placed in a folder structure that can be copied so new skins based on the originals can be added. Providing they share the same names, linkage id&#8217;s and positions of the original skin, these new assets can easily be swapped for the originals to create a new skin, but you are restricted to the basic structure defined in the master component.</p>
<p>Where a number of states are used there is a folder for each state within the skin. Personally, I&#8217;d like to see a way of changing simple elements like colours dynamically to reduce the amount of visual elements required. The Shuriken Components seem to take this approach, drawing the components dynamically for all states instead of relying on visual assets.</p>
<p>The Nokia components also manage state by hiding the various states and swapping between them, which isn&#8217;t great for memory usage as it increases the amount of MovieClips on the stage at a given time. I&#8217;d experiment with removing them from the stage when they weren&#8217;t needed instead of hiding them.</p>
<h2>Scaling visual elements</h2>
<p>The Nokia Components visual elements are cut up so they are scalable, which means their width and height can be altered dynamically without distortion. This has been achieved by separating out intricate elements such as rounded corners, edges and base backgrounds. The AS Class that manages the component then looks for a placeholder movieclip the developer places within the stage and resizes all the visual elements using a scaling multiplier to match the dimensions of the placeholder.</p>
<p>The placeholder technique is a clever one, and a great idea for visual developers. It does mean more movieclips on the stage though, and places all the control in the hands of the Flash visual IDE. In our own apps, I would ensure the components could accept a width and height submitted to the AS Class using its API instead of relying on a placeholder, which would reduce the size of the final SWF and moves control of the components back into the apps Classes.</p>
<p>Since the Shuriken framwork uses dynamic resources these components also scale very nicely.</p>
<h2>Targeting different devices</h2>
<p>Nokia have considered device targeting, and use the placeholder technique combined with multiple frames to manage different sizes (its all explained in the <a href="http://www.forum.nokia.com/info/sw.nokia.com/id/332b6e95-b173-4b58-8552-4639795212f9/Guide_to_Flash_Lite_Components.html">guide to using and creating Flash Lite Components</a>). I&#8217;m not a fan of adding frames into the stage, and would perhaps use a build process, perhaps with rake and MTASC to generate different swf&#8217;s with different resource sizes. That&#8217;s a blog post for another day for sure!</p>
<h2>Conclusions</h2>
<p>Nokia have done some great work in this field, laying the ground for people to develop custom components. However, I feel their components may be a little too bloated for many existing devices to cope with. I&#8217;d love to hear some feedback from them on this &#8211; do they not feel their recommended methods result in swf&#8217;s that are simply too large, and lead to high memory usage apps? There is no denying the ease of use and installation of these components though.</p>
<p>I feel that taking things forward, we can learn from both Nokia and Jesse Warden&#8217;s Shuriken Framework, the space is wide open for someone to come up with a well documented and useable yet relatively light and optimised framework and set of sample components for Flash Lite. Are you working on such a thing? Leave your comments and thoughts below. I&#8217;m off to work on my own ideas now!</p>
<h2>Key references and people to follow&#8230;</h2>
<ul>
<li><a href="http://www.forum.nokia.com/">Forum Nokia</a></li>
<li><a href="http://www.flashmobileblog.com/">Mark Doherty of Adobe</a></li>
<li><a href="http://jessewarden.com/">Jesse Warden</a>, Flex and Flash RIA dev</li>
<li>Pinbadge Actionscript image care of Joe Pemberton of fellow mobile UI guys <a href="http://www.punchcut.com/index.php">Punchcut</a> <a rel="cc:attributionURL" href="http://www.flickr.com/photos/joepemberton/">http://www.flickr.com/photos/joepemberton/</a> / <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/">CC BY-NC-ND 2.0</a></li>
<li><a href="http://ribot.co.uk/">Ribot</a>, the mobile user interface team behind the project I&#8217;m working on that inspired this research &#8211; you&#8217;ll be hearing more about Flash Mobile components from us in the coming months methinks&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/flash-lite-components-an-introduction/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The geek and tech scene in Brighton</title>
		<link>http://mark-kirby.co.uk/2009/the-geek-and-tech-scene-in-brighton/</link>
		<comments>http://mark-kirby.co.uk/2009/the-geek-and-tech-scene-in-brighton/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 17:35:16 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[BNM]]></category>
		<category><![CDATA[brighton]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=550</guid>
		<description><![CDATA[People often ask me how to get involved with the tech scene in Brighton either for social reasons, or to find work. This post should provide a place for me to direct them, and perhaps help anyone else wondering or perhaps even unaware there is such a scene.
Here are my top suggestions for getting involved&#8230;
1 [...]]]></description>
			<content:encoded><![CDATA[<p>People often ask me how to get involved with the tech scene in Brighton either for social reasons, or to find work. This post should provide a place for me to direct them, and perhaps help anyone else wondering or perhaps even unaware there is such a scene.</p>
<p>Here are my top suggestions for getting involved&#8230;</p>
<h2>1 &#8211; Attend an event</h2>
<p>The easiest way to get started is to get along to an event. There a number of regular/semi regular events as well as one offs and occasional festival type events and conferences, I&#8217;ve listed them below along with frequency and price. Many of these are free, and some are more tuned to networking than others.</p>
<p>My advice &#8211; start with an event that has a focus (i.e. a speaker) and see who you can get talking to at the end, it&#039;s always better to deal with people in person instead of via <a href="http://www.powwownow.co.uk/">a phone conference call</a>. Complement this with some regular trips to The Farm which will get your face known by people you might bump into at some of the other events. You&#8217;ll soon find you know lots of people, and start getting introduced to others.</p>
<h3>Weekly meetups</h3>
<p>For those who just want to meet people and possibly find some work there is the <a href="http://www.brightonfarm.com/">Brighton Farm</a>, a meetup for Freelancers, although anyone is welcome. There&#8217;s normally at least 10 people in attendence (often more), and it takes the form of sitting round a table in a pub for the first hour, so its easy to take a seat and get chatting to the person next to you &#8211; none of this walking up to people you don&#8217;t know. As the evening wears on it gets livelier, and subsequently harder to meet new people so a good tip would be to get there early. There&#8217;s always a good mix of regulars and newcomers, so you won&#8217;t be the only one. Check the website for details, but they always meet in a local pub at 7:30 &#8211; look for the people with the tech book on the table. Free to attend, no need to book.</p>
<p><a href="http://www.flashbrighton.org/wordpress/">FlashBrighton</a> meets every Tuesday at The Werks, and focuses on a 1 &#8211; 2 hour presentation or workshop, often followed by drinks. It was originally aimed at Flash developers, although plenty of people who go along focus on other platforms as well, and the talks often focus on other platforms and areas. The quality of the talks is always high and as its weekly you can quickly get to know people by attending regularly. There&#8217;s a different crowd here to some of the other events so well worth popping along to and giving it a try. Free to attend but you must book.</p>
<h3>Semi-regular meetups</h3>
<p>There are plenty of occasional meetups to suit a wide range of interests. Pick one, or try them all out for size. The meetings generally take place at <a href="http://theskiff.org/">The Skiff</a> or <a href="http://thewerks.org.uk/">The Werks</a> (so keep an eye on their sites for details of new groups), and have one or more speakers followed by a trip to a nearby pub where you can get chatting to people. Don&#8217;t forget to book tickets by going to the sites listed &#8211; these often sell out.</p>
<p>Here a selection:</p>
<p><a href="http://fivepoundapp.com/">£5 app</a> features people demoing apps they&#8217;ve worked on in their spare time, or funded themselves. Often some fascinating stories come out of this meetup, and there&#8217;s lots to interest designers, developers and entrepreneurs alike. You can easily apply to do a demo on their site as well. Free to attend but you must book.</p>
<p><a href="http://uxbrighton.org.uk/">UX Brighton</a> is essentially a mini 2 hour conference with a focus on crafting a great user experience. One or two speakers will present their thoughts and experiences with UX design, and explain how they or their companies achieved success (or failure) in the UX field. A top quality event for anyone with an interest in UX. Generally takes place in a local office, followed by pub. Free to attend but you must book.</p>
<p><a href="http://skillswap-brighton.org/">Skillswap Brighton</a> is organised by Clearleft and features an expert sharing some of their knowledge in their field, be it design, development or UX. Speakers are always excellent as they are carefully vetted by the Clearleft team who also organise world renowned events such as dConstruct and UXLondon. Another one that always sells out &#8211; keep an eye their site. Free to attend but you must book a ticket.</p>
<h2>Conferences</h2>
<p>Brighton plays host to a range of conferences which attract people from all over the world, so if your looking to connect with people from outside Brighton as well as locals, you don&#8217;t need to go far.</p>
<p><a href="http://www.barcampbrighton.org/">BarcampBrighton</a> is an unconference, where everyone who attends gets a chance to speak. I helped to organise the last one and it was a great success. It takes place over a weekend and as such presents an excellent opportunity to connect with people over a longer period of time. Think tech conference meets weekend break. The next one is due in September 2009, at the university of Sussex. Free to attend but tickets are required.</p>
<p><a href="http://2009.dconstruct.org/">dConstruct</a> is one of the best conferences I&#8217;ve ever attended. Organised by Clearleft, held at The Dome, single day event, the speakers are always world renowned, never pitch and always focus on interesting topics or aspects of design and development in web, mobile, gaming and more. This one pushes the boundaries of what makes a tech conference. Tickets from £120, next one in September.</p>
<p><a href="http://www.flashonthebeach.com/">Flash On The Beach</a> is a three day event for Flash developers and designers, also held at the Dome, costs around £300. Next one in September.</p>
<p><a href="http://2009.full-frontal.org/details">Full Frontal</a> is a new one day conference for Javascript people, its being held at The Duke of Yorks this October. £100.</p>
<h2>2 &#8211; Work in a co-working space</h2>
<p>One of the best ways to meet people is to work alongside them. Let them know what you specialise in, and they&#8217;ll be able to turn to you &#8211; literally &#8211; when they get that call. There are two spaces in Brighton which both allow you to drop in for the day to try them out for free, and then allow you to hot desk on a semi regular basis or rent a desk for a reasonable free. <a href="http://thewerks.org.uk/">The Werks</a> is in Hove and is the larger of the two, or try <a href="http://thewerks.org.uk/">The Skiff</a> for a cosier option in the North Laines. I&#8217;d say as the Skiff is smaller you&#8217;d be more likely to be noticed and get chatting to people there, but a wider range of people make their way through The Werks and there are several companies located inside it. Why not try both?</p>
<p>More suggestions anyone?</p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/the-geek-and-tech-scene-in-brighton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Structuring Flash Lite code the MVC way</title>
		<link>http://mark-kirby.co.uk/2009/structuring-flash-lite-code-the-mvc-way/</link>
		<comments>http://mark-kirby.co.uk/2009/structuring-flash-lite-code-the-mvc-way/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 12:25:29 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=538</guid>
		<description><![CDATA[Advice on how to structure your Flash and Flash Lite code in an MVC way, also taking principles of build from Java's ANT tool. Aimed at those already using classes to develop Flash Lite code.]]></description>
			<content:encoded><![CDATA[<p>I recently had a discussion with Thomas Joos on ways of structuring code that conform to basic standards. Taking his ideas on board and combining them with some of my own, I propose this simple structure which can serve as the starting point for a new Flash Lite or Flash project. This is based on the MVC model, and ANT for JAVA.</p>
<h2>The root</h2>
<p>The root of your project could contain the following folders:</p>
<ul>
<li>build</li>
<li>deploy</li>
<li>src</li>
</ul>
<p>Here&#8217;s more details on each</p>
<h3>build</h3>
<p>The build folder is for your Flash output, generated during the build process.</p>
<p>You can set this folder in Flash CS4 by opening the .fla file and going to : &#8220;File -&gt; Publish settings&#8230;&#8221; in the menu, and then navigating to the build folder to set the file for the Flash type in the popup which comes up.</p>
<p>The build folders contents should be able to be deleted at any time, and recreated by running the build. Do not keep any source files or the .fla in here!</p>
<h3>deploy</h3>
<p>The deploy folder is a good place to keep your installers, such as the .sis files produced by the Adobe Mobile Packager, or other packagers.</p>
<h3>src</h3>
<p>The src folder is the place to keep your source code, that&#8217;s your .fla and related .as files, structured as explained in the following section.</p>
<h2>The source code folder</h2>
<p>As mentioned, all your source code should be kept in the src folder.</p>
<p>The structure of src folder will look something like this:</p>
<ul>
<li>com</li>
<ul>
<li>companyName</li>
<ul>
<li>appName</li>
<ul>
<li>controller</li>
<li>model</li>
<li>view</li>
<li>main.as</li>
</ul>
<li>utils</li>
<li>components</li>
</ul>
</ul>
<li>appName.fla</li>
</ul>
<p>So your .fla file goes into the root of src, alongside a folder structure unique to your company, which will also be reflected in the namespaces you give your classes.</p>
<p>The classes specific to the app go within a folder with the same name as the app, and the classes which can be used in other applications are placed alongside this folder in their own folders. I&#8217;ll go into more detail on the contents of each folder next. </p>
<h3>appName</h3>
<p>Within the appName folder, you place the classes which cannot be reused in other applications and are specific to this application. These will form the core of this individual application.</p>
<p>You will also place a main.as file here which will be called from the .fla file and will call the various controllers to manage the app.</p>
<h4>model</h4>
<p>In the model folder you store datatypes declaring data formats used within the app, as well as perhaps classes to manage arrays of data stored and kept in memory whilst the app is running.</p>
<h4>view</h4>
<p>In the view folder you store classes relating to screens as well as components that you only want to use within this app.</p>
<h4>controller</h4>
<p>In the controller folder you can store classes relating to the logic of the programme, a key controller to manage what key is pressed and when, a screen controller to manage what screen is currently being displayed, perhaps an API controller to manage all the API calls. The classes here will work closely with the view and the model, building views and manipulating the model. They will be called initially from your main.as class.</p>
<h3>utils</h3>
<p>Within the utils folder you place helpers and utilities which can be reused in other apps. You should be able to drop classes in here and just start reusing them.</p>
<h3>components</h3>
<p>Within the components folder you place classes which relate to visual components of your app, stored in the library of the .fla. These components classes, although may come with different assets in another app, can always be reused and will always behave in the same way when placed in another app.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/structuring-flash-lite-code-the-mvc-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to debug the Shared Object in Device Central</title>
		<link>http://mark-kirby.co.uk/2009/how-to-debug-the-shared-object-in-device-central/</link>
		<comments>http://mark-kirby.co.uk/2009/how-to-debug-the-shared-object-in-device-central/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 15:23:23 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=532</guid>
		<description><![CDATA[How to access the shared object in Device Central for debugging purposes. Not a simple method, but one that works nonetheless.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick tutorial explaining how to inspect and debug the shared object created on device central when running tests on Flash Lite apps. Its not simple and took me some work to figure out. If you know a better way, please let me know.</p>
<p>This tutorial is aimed at OS X 10.5 users, with Device Central CS4.</p>
<h2>1 &#8211; Get a capable unarchiver</h2>
<p>You need a file unarchiver which can cope with .cpgz files. The only one I could find was <a href="http://echoone.com/filejuicer/">File Juicer</a> which costs around $12 &#8211; if anyone finds a free one, let me know.</p>
<h2>2 &#8211; Extract the Shared Object file</h2>
<p>Navigate to your home folder and &#8220;Library/Application Support/Adobe/Adobe Device Central CS4&#8243;.</p>
<p>Locate the file named storageObjects.bin and drag it onto the File Juicer icon in your apps.</p>
<p>A folder should appear named &#8220;Storage Objects Juice&#8221;, containing a folder named &#8220;txt&#8221;, containing a file called something like StorageObject(xx% copy)-1.txt &#8211; this is the file you&#8217;ll need.</p>
<h2>3 &#8211; Interpreting the StorageObject file</h2>
<p>Open the txt file with your editor of choice. You will see likely see lots of text, expand the text editor to fill your screen to make things easier.</p>
<p>This file contains reference to all saved shared objects, so to see the latest you need to be at the bottom of the file.</p>
<p>Look for codes resembling &#8220;B81FA49052AAA2BD750992BCFD03478D 8144600B02252A799C14CCE2BC9F50B6 ø TCSO &#8221; &#8211; this appears to be the delimiter between shared object sessions. </p>
<p>Directly following each of delimiter you will find the name of your shared object, the name of the shared object element, and any data saved. </p>
<p>The layout isn&#8217;t great, line breaks are seemingly random, and its clear this file was not meant for human consumption. Until Adobe add a Shared Object inspector to Device Central, its all we got though, as far as I know.</p>
<p>Anyone got an easier method?</p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/how-to-debug-the-shared-object-in-device-central/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing a Flash Lite Client for a REST API</title>
		<link>http://mark-kirby.co.uk/2009/writing-a-flash-lite-client-for-a-rest-api/</link>
		<comments>http://mark-kirby.co.uk/2009/writing-a-flash-lite-client-for-a-rest-api/#comments</comments>
		<pubDate>Fri, 29 May 2009 14:12:28 +0000</pubDate>
		<dc:creator>kirby.mark</dc:creator>
				<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://mark-kirby.co.uk/?p=515</guid>
		<description><![CDATA[Advice on writing a Flash Lite client for a REST API. Covers limitations of Flash Lite, changes you might need to make to your API, reasons someone else's API might not work, and pointers on how to GET and POST data.]]></description>
			<content:encoded><![CDATA[<p>This tutorial explains how to create a flash REST API client that works with Actionscript 2 and Flash Lite 3.1+. Its not as simple as you might think, but the most complex part is knowing and understanding all the restrictions, many of which I&#8217;ve outlaid here.</p>
<h2>API restrictions</h2>
<p>Unfortunately there are some restrictions within Flash Lite which means you will only be able to access certain API&#8217;s. Before continuing, ensure the API you are trying to access meets the following criteria. If its your API, you are in luck, you can fix these issues.</p>
<h3>Crossdomain Policy</h3>
<p>You will need to be accessing an API which has a crossdomain policy file in place. If you own the API you can <a href="http://www.moock.org/asdg/technotes/crossDomainPolicyFiles/">create one</a>. If not you will need to create a proxy &#8211; although that&#8217;s out of scope of this tutorial.</p>
<h3>Authentication</h3>
<p>Flash Lite does not work with HTTP header based security using the &#8220;Authorize&#8221; header. The function for adjusting headers &#8211; XML.addRequestHeader has a bug. In addition, you cannot use the addRequestHeader feature unless you are making a POST request, bug or no bug. This means for GET request you need to find another way of authenticating anyway. If the API you have access to doesn&#8217;t allow any other means of authentication, you won&#8217;t be able to write a Flash Lite client. </p>
<p>If you have control of the API, ensure it can read the user credentials from the URL for GET requests, and from either the URL or parameter body for POST requests. That way you can avoid having to use addRequestHeader. </p>
<h3>HTTP Status codes</h3>
<p>Flash can&#8217;t easily interpret HTTP status codes. The API should therefore have an option for returning status in either an XML or string format. The HTTP status should always be 200, with the actual success code returned in the body of the content. This code can then be interpreted by Flash. </p>
<p>Please note, for POST&#8217;s, the status returned should be of the same type (either XML or string) as the data posted. So in other words if you pass XML to the API to POST data, the status should be returned as XML, if you pass name key pairs to POST data, the status should be returned as a plain text name key pair (e.g. name=xxxx). If the API interprets POSTed data in chunks of XML, it should return the status as XML. This enables you to use either XML.sendAndLoad to send and read XML or LoadVars.sendAndLoad to send and read variables. You can&#8217;t (as far as I can tell) send XML and read variables, or send variables and read XML. </p>
<h3>PUT and DELETE</h3>
<p>You can&#8217;t make PUT and DELETE requests from Flash (or indeed any browser), so you will need to ensure your API uses overloaded POST. That is, you can specify the PUT or DELETE method in the POST url and the API interprets it, or you can make edits and deletes through the basic POST or GET functions.</p>
<h2>Flash Lite checklist</h2>
<p>You will need to make a few updates to your app before connecting to the API.</p>
<h3>Playback settings</h3>
<p>Ensure you have set the playback settings to access network only (File in top menu -> Publish Settings option -> Flash tab -> Advanced section -> Local playback security dropdown -> set to Access network only)</p>
<h3>Device central</h3>
<p>Ensure you have selected a Flash Lite 3.1 device in Device Central for testing.</p>
<p>Ensure under the device central security settings you have selected &#8220;Local Trusted Sandbox&#8221;.</p>
<h3>Flash Lite security settings</h3>
<p>When testing on a device as a swf, if you find network errors, ensure the swf is placed inside the Flash Lite trusted folder, if available. Location of the trusted folder will vary from device to device, but for Nokia&#8217;s N95 its located in C:/Data/Others/Trusted. Note that the Others folder may appear as Other without the s &#8211; this is not an issue. If you can&#8217;t find the Trusted folder inside Other(s), create it. To access the swf from the device just navigate directly to C:/Other(s), the data folder won&#8217;t appear within the phone view. There&#8217;s more on this topic on <a href="http://bloggy.kuneri.net/2008/05/13/the-pain-of-flash-lite-30">Kuneri Bloggy</a>.</p>
<h2>Making a GET request</h2>
<p>To perform a GET request, returning XML you use the <a href="http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html">XML.load</a> method. </p>
<p>[code lang="actionscript"]<br />
var my_xml:XML = new XML();</p>
<p>my_xml.onLoad = function(success:Boolean) {</p>
<p>    var endTime:Number = getTimer();</p>
<p>    var elapsedTime:Number = endTime-startTime;</p>
<p>    if (success) {<br />
	    trace("xmlDecl:"+my_xml.xmlDecl);<br />
	    trace("contentType:"+my_xml.contentType);<br />
	    trace("docTypeDecl:"+my_xml.docTypeDecl);<br />
            trace("packet:"+my_xml.toString());<br />
    } else {<br />
	    trace("Unable to load remote XML.");<br />
    }</p>
<p>    trace("loaded in: "+elapsedTime+" ms.");</p>
<p>};<br />
my_xml.load("http://api.url.com/user/1.xml");<br />
[/code]</p>
<p>You get the idea, you could create a text field to output the data on the device, manipulate the xml etc.</p>
<p>To perform a GET request returning name value pairs, you use the <a href="http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html">LoadVars.load</a> method.</p>
<p>[code lang="actionscript"]<br />
var myLoadVars:LoadVars = new LoadVars();<br />
myLoadVars.onLoad = function(success:Boolean) {<br />
    if (success) {<br />
        trace(this.toString());<br />
    } else {<br />
        trace("Error loading/parsing LoadVars.");<br />
    }<br />
};<br />
myLoadVars.load("http://api.url.com/user/1.json");<br />
[/code]</p>
<h2>POST request</h2>
<p>To make a POST request by sending name value pairs and processing a returned status code in name value format, you use the <a href="http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html">LoadVars.sendAndLoad</a> method.</p>
<p>In this example we are posting a name value pair of &#8220;name=New Category&#8221;, with the server interpreting the field name, and returning either &#8220;error=404&#8243; or &#8220;status=200&#8243; as plain text output. The code interprets either the error or the status and traces it out to the console. You would probably interpret it in some way and do something more with it.</p>
<p>[code lang="actionscript"]<br />
var resultLoadVars:LoadVars = new LoadVars();<br />
resultLoadVars.onLoad = function(success:Boolean) {<br />
	if (success) {<br />
		if (resultLoadVars.error !== undefined) {<br />
        	trace("error: "+result_lv.error);<br />
		}<br />
		if (resultLoadVars.status !== undefined) {<br />
        	trace("status: "+result_lv.status);<br />
		}<br />
	} else {<br />
    	trace("Error connecting to server.");<br />
	}<br />
};<br />
var send_lv:LoadVars = new LoadVars();<br />
send_lv.name = "New Category";<br />
send_lv.sendAndLoad("http://api.url.com/user/1", result_lv, "POST");<br />
[/code]</p>
<p>To make a POST request by sending XML and processing a returned status code in XML format, you use the <a href="http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=Part2_AS2_LangRef_1.html">XML.sendAndLoad</a> method.</p>
<p>In this example we are posting xml containing the tag name with content &#8220;New Category&#8221;, with the server interpreting the field name, and returning either an error tag with the code &#8220;404&#8243; or  a status tag with the code &#8220;200&#8243; as XML. The code interprets either the error or the status and traces it out to the console. You would probably interpret it in some way and do something more with it.</p>
<p>[code lang="actionscript"]<br />
var dataToPost:String = "<name>New Category</name>";<br />
var my_xml:XML = new XML(dataToPost);<br />
var myReply_xml:XML = new XML();<br />
myReply_xml.ignoreWhite = true;<br />
myReply_xml.onLoad = myOnLoad;<br />
my_xml.sendAndLoad("http://api.url.com/user/1", myReply_xml);<br />
function myOnLoad(success:Boolean) {<br />
    if (success) {<br />
        if ((myReply_xml.firstChild.nodeName == "error")) {<br />
            trace("error: "+myReply_xml.firstChild);<br />
        }<br />
        if ((myReply_xml.firstChild.nodeName == "status")) {<br />
            trace("status: "+myReply_xml.firstChild);<br />
        }<br />
    } else {<br />
       trace("Error connecting to server.");<br />
    }<br />
}<br />
[/code]</p>
<h2>Next steps</h2>
<p>Don&#8217;t worry too much about following the code examples here, follow the links to the adobe documentation and see if you can get the code to work with the API you have. I&#8217;m starting out in this area too &#8211; so have really just presented my initial findings after a couple of days research &#8211; hopefully this will save some of you that time at least! Leave issues or problems with specific devices, links to better ways of doing things or suggestions in the comments. </p>
]]></content:encoded>
			<wfw:commentRss>http://mark-kirby.co.uk/2009/writing-a-flash-lite-client-for-a-rest-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
