<?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>Kilometer0.com Blog</title>
	<atom:link href="http://www.kilometer0.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kilometer0.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 28 Mar 2010 04:39:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SWFAddress + AS3Signals + RobotLegs Demo</title>
		<link>http://www.kilometer0.com/blog/2010/03/27/swfaddress-as3signals-robotlegs-demo/</link>
		<comments>http://www.kilometer0.com/blog/2010/03/27/swfaddress-as3signals-robotlegs-demo/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 04:34:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[as3signals]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[swfaddress]]></category>

		<guid isPermaLink="false">http://www.kilometer0.com/blog/?p=119</guid>
		<description><![CDATA[As a follow up to my previous post on an SWFAddress helper class that uses AS3Signals instead of events, I created a demo application that combines SWFAddress, AS3Signals, and RobotLegs.  I used this structure on an app I currently built successfully and would use it again.  Comments and suggestions are encouraged. The key pieces to [...]]]></description>
			<content:encoded><![CDATA[<p>As a follow up to my <a href="http://www.kilometer0.com/blog/2010/03/02/swfaddress-as3signals-robotlegs/">previous post</a> on an SWFAddress helper class that uses AS3Signals instead of events, I created a demo application that combines SWFAddress, AS3Signals, and RobotLegs.  I used this structure on an app I currently built successfully and would use it again.  Comments and suggestions are encouraged.</p>
<p>The key pieces to this application are: SWFAddress helper class that uses AS3Signals, the application model, the view state model, a command to pass the application model parameters to SWFAddress, and a command to process SWFAddress changes and update the application model.</p>
<p><span id="more-119"></span></p>
<h2>SWFAddress</h2>
<p>You can grab the updated SWFAddress file <a href="http://www.kilometer0.com/blog/wp-content/uploads/2010/03/SWFAddress.as">here</a>.  Right now it&#8217;s in the com.kilometer0 package, but you can move it to whatever package you want.  It&#8217;s not dependent on any files.</p>
<p>The relevant signals are:</p>
<pre>/**
  * Dispatched when <code>SWFAddress</code> initializes.
  */
public var init:Signal;

/**
  * Dispatched when any value change.
  */
public var change:Signal;

/**
  * Dispatched when value was changed by Flash.
  */
public var internalChange:Signal;

/**
  * Dispatched when value was changed by Browser.
  */
public var externalChange:Signal;</pre>
<h2>Application Model</h2>
<p>The application model class holds the variables that your application uses to build it&#8217;s state.  In my demo, I modify the ApplicationModel class whenever a user has performed an action that needs to update the state of the application.</p>
<pre>public class ApplicationModel extends Actor
{
	public var option1:String;
	public var option2:String;
}</pre>
<h2>View State Model</h2>
<p>I used the View State Model to hold values related to building views. In my demo, this is a super simple class that just has the current view name.  When the view name is changed, a ViewStateChanged signal is dispatched.  This signal is a singleton managed by RobotLegs and is injected into the class when it&#8217;s instantiated.  This signal is handled by the MainUIMediator in the demo.  The mediator then calls the current view and tells it to hide, then creates the new view if it doesn&#8217;t exist already, then shows the new view.</p>
<pre>public class ViewStateModel extends Actor
{
	[Inject]
	public var viewStateChanged:ViewStateChanged;

	protected var _viewName:String;

	public function get viewName():String { return _viewName; };
	public function set viewName(val:String):void
	{
		var changed:Boolean = val != _viewName;
		_viewName = val;
		if(changed)
			viewStateChanged.dispatch();
	}
}</pre>
<h2>The Change Application State Command</h2>
<p>This command is wired to the ModifyApplicationState signal.  When the signal is dispatched, this command gets executed.  It takes the parameters from the ViewStateModel and ApplicationModel then converts them into a URL that is passed to SWFAddress.  SWFAddress then modifies the browser address bar, which SWFAddress captures and in turn dispatches a signal letting the application know that the state has been modified.</p>
<pre>public class ChangeApplicationStateCommand extends SignalCommand
{
	[Inject]
	public var appModel:ApplicationModel;

	[Inject]
	public var viewState:ViewStateModel;

	[Inject]
	public var swfAddress:SWFAddress;

	override public function execute():void
	{
		trace("ChangeApplicationStateCommand: execute");
		var url:String = "/"+viewState.viewName+"?";
		if(appModel.option1 != null)
			url+="op1="+appModel.option1;
		if(appModel.option2 != null)
			url+="&amp;op2="+appModel.option2;

		swfAddress.setValue(url);

	}

}</pre>
<h2>The Application State Changed Command</h2>
<p>This command gets fired when SWFAddress is modified.  It parses the SWFAddress URL and parameters and sets them on the ApplicationModel and ViewStateModel.</p>
<pre>public class ApplicationStateChangedCommand extends SignalCommand
{
	[Inject]
	public var viewState:ViewStateModel;

	[Inject]
	public var appModel:ApplicationModel;

	[Inject]
	public var swfAddress:SWFAddress;

	override public function execute():void
	{
		trace("ApplicationStateChangedCommand: execute");
		trace(swfAddress.getValue());

		appModel.option1 = swfAddress.getParameter("op1") as String;
		appModel.option2 = swfAddress.getParameter("op2") as String;

		viewState.viewName = swfAddress.getPath().substr(1);

	}

}</pre>
<p>You can view the demo of the application and how it works here: <a href="/demos/sasrl/">/demos/sasrl/</a>.</p>
<p>You can download the demo application source code here (Flex Builder AS3 Only project): <a href="http://www.kilometer0.com/blog/wp-content/uploads/2010/03/SWFAddressSignalsRobotLegs.zip">SWFAddressSignalsRobotLegs.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kilometer0.com/blog/2010/03/27/swfaddress-as3signals-robotlegs-demo/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SWFAddress + AS3Signals + RobotLegs</title>
		<link>http://www.kilometer0.com/blog/2010/03/02/swfaddress-as3signals-robotlegs/</link>
		<comments>http://www.kilometer0.com/blog/2010/03/02/swfaddress-as3signals-robotlegs/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 06:56:18 +0000</pubDate>
		<dc:creator>Alexandru Petrescu</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[as3signals]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[swfaddress]]></category>

		<guid isPermaLink="false">http://www.kilometer0.com/blog/?p=114</guid>
		<description><![CDATA[I recently started working with RobotLegs and AS3Signals on a project just to get some experience with these new frameworks. I wanted to add deep linking support, so I reached for my trusty friend SWFAddress. I felt bad about adding Event listeners in my nice clean RobotLegs + SignalCommandMap + AS3Signals project, so I modified [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started working with RobotLegs and AS3Signals on a project just to get some experience with these new frameworks. I wanted to add deep linking support, so I reached for my trusty friend SWFAddress. I felt bad about adding Event listeners in my nice clean RobotLegs + SignalCommandMap + AS3Signals project, so I modified the SWFAddress.as class that came with the examples to use AS3Signals instead of normal Events.</p>
<p>I thought this might be useful to others starting out using AS3Signals and RobotLegs.</p>
<p>Check out the code and examples here: <a href="http://www.kilometer0.com/blog/code/swfaddress-and-as3signals/">http://www.kilometer0.com/blog/code/swfaddress-and-as3signals/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kilometer0.com/blog/2010/03/02/swfaddress-as3signals-robotlegs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Twitter Status URL&#8217;s and Ampersands</title>
		<link>http://www.kilometer0.com/blog/2010/01/21/twitter-status-urls-and-ampersands/</link>
		<comments>http://www.kilometer0.com/blog/2010/01/21/twitter-status-urls-and-ampersands/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 17:23:49 +0000</pubDate>
		<dc:creator>Alexandru Petrescu</dc:creator>
				<category><![CDATA[WebDev]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.kilometer0.com/blog/?p=100</guid>
		<description><![CDATA[Recently I&#8217;ve had to do a bit of integration with Twitter on a site I was working on.  In order to allow people to easily post links to Twitter, I created specially formed URL&#8217;s to pass a message and link to Twitter. Making the URL is simple, it looks something like this: http://www.twitter.com/home?status=Your+Message+http://mylink.com However, if [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve had to do a bit of integration with Twitter on a site I was working on.  In order to allow people to easily post links to Twitter, I created specially formed URL&#8217;s to pass a message and link to Twitter.</p>
<p>Making the URL is simple, it looks something like this:</p>
<p><a href="http://www.twitter.com/home?status=Your+Message+http://mylink.com" target="_blank">http://www.twitter.com/home?status=Your+Message+http://mylink.com</a></p>
<p>However, if you add an Ampersand (&amp;) to the message it breaks the URL, like so:</p>
<p><a href="http://www.twitter.com/home?status=Your+Message+&amp;+something+http://mylink.com" target="_blank">http://www.twitter.com/home?status=Your+Message+&amp;+something+http://mylink.com</a></p>
<p><span id="more-100"></span></p>
<p>You can escape the ampersand using %26, however it shows up as %26 in the actual message, like so:</p>
<p><a href="http://www.twitter.com/home?status=Your+Message+%26+something+http://mylink.com" target="_blank">http://www.twitter.com/home?status=Your+Message+%26+something+http://mylink.com</a></p>
<p>It seems that Twitter doesn&#8217;t want to use www.twitter.com as their main domain.  They want to use twitter.com, so they redirect.  When they redirect, it does encodes the previous url and passes it to the twitter.com domain.  So %26 turns into %2526 (%25 = %).</p>
<p>However, if you form your url to go directly to http://twitter.com it won&#8217;t do the redirect and it&#8217;ll work just fine.  So the final good url is:</p>
<p><a href="http://twitter.com/home?status=Your+Message+%26+something+http://mylink.com" target="_blank">http://twitter.com/home?status=Your+Message+%26+something+http://mylink.com</a></p>
<p>Last tip, if you use this method of posting to Twitter, make sure you send the user to http://twitter.com/home?status=your+message and not to http://twitter.com/?status=your+message.  The http://twitter.com URL works if you&#8217;re already logged in (which you might be if you&#8217;re developing the application), but if you have to login first, it won&#8217;t forward the message.  Going to the /home page will allow you login and then forward the message.</p>
<p>Also, when making the url&#8217;s make sure you use +&#8217;s and not %20&#8242;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kilometer0.com/blog/2010/01/21/twitter-status-urls-and-ampersands/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Hello Droid</title>
		<link>http://www.kilometer0.com/blog/2009/12/28/hello-droid/</link>
		<comments>http://www.kilometer0.com/blog/2009/12/28/hello-droid/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 01:17:58 +0000</pubDate>
		<dc:creator>Alexandru Petrescu</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mobile Dev]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.kilometer0.com/blog/?p=94</guid>
		<description><![CDATA[Recently I picked up a new Motorola Droid phone and an HTC Droid Eris for the misses. I have done some iPhone development, however, I&#8217;ve never picked up an iPhone because ATT coverage in NYC is terrible. So I wanted to see how easy it would be to write a simple Android based app. I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I picked up a new Motorola Droid phone and an HTC Droid Eris for the misses. I have done some iPhone development, however, I&#8217;ve never picked up an iPhone because ATT coverage in NYC is terrible. So I wanted to see how easy it would be to write a simple Android based app.<img title="More..." src="http://www.kilometer0.com/blog/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p>I&#8217;m this blog post will outline steps I took to get setup. I often find blog posts like this helpful for people getting started. There are plenty of resources right now on it, but one more couldn&#8217;t hurt. I&#8217;m using Windows 7 64bit, so the issues I run into might or might not be related. Either way I&#8217;ll try to solve them along the way.</p>
<p>Initial downloads:</p>
<ol>
<li>Eclipse 3.5 from <a href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a> Windows 32bit via BitTorrent</li>
<li>Android SDK from <a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a></li>
</ol>
<p>Eclipse Setup:</p>
<ol>
<li>Install Developer Tools using Eclipse Update from this site: https://dl-ssl.google.com/android/eclipse/</li>
<li>Restart Eclipse</li>
<li>Go to Preferences -&gt; Android and enter in folder of Android SDK</li>
</ol>
<p>Android SDK Setup:</p>
<ol>
<li>Run SDK Setup.exe in the Android SDK directory.</li>
<li>If it can&#8217;t connect, go to &#8220;Settings&#8221; and select force https sources to be fetched using http (I had to do this).</li>
<li>I installed Documentation, USB Driver, SDK 2.0.1 (for Droid Phone), SDK 1.5 (for Droid Eris), and the respective Google Api&#8217;s (3 for 1.5 and 6 for 2.0.1)</li>
<li>Once Installed, click Devices.</li>
<li>Create 2 devices, one for each phone / SDK.</li>
<li>To setup the &#8220;Path&#8221;, Go to Start menu -&gt; Right click on Computer -&gt; select Properties -&gt; Advanced Settings -&gt; Environment Variables -&gt; Find &#8220;Path&#8221; in the bottom list.</li>
<li>Copy / Paste your Android SDK / Tools directory from Explorer and add it to the end of the Path variable.  Ad</li>
</ol>
<p>USB Driver Setup:</p>
<ol>
<li>On the Phone go to Settings -&gt; Application Settings -&gt; Development -&gt; Check USB Debugging</li>
<li>Plug in Phone to computer</li>
<li>Windows 7 said &#8220;Couldn&#8217;t find driver&#8221;.</li>
<li>Click on Start menu, right click Computer, click Manage, select Device Manager.</li>
<li>Find the Motorola device with the yellow yield icon.  Right click and select Update Device Software.</li>
<li>Select &#8220;Browse my computer&#8221;.  Point the search at the Android SDK -&gt; USB Driver folder.</li>
</ol>
<p>Now for the Hello World App. I used the tutorial here: <a href="http://developer.android.com/resources/tutorials/hello-world.html">http://developer.android.com/resources/tutorials/hello-world.html</a></p>
<p>When you have the phone plugged in via USB and you &#8220;Run&#8221; or &#8220;Debug&#8221; it&#8217;ll run on the phone if the emulator isn&#8217;t running.  It was weird at first, because I couldn&#8217;t figure out why it wasn&#8217;t showing up in the emulator.  I unplugged the phone, and the app ran in the debugger (which took a little while to load).  When running or debugging that application later, you can chose to run on the phone or the emulator.</p>
<p>Thats it for the &#8220;Hello World App&#8221;.  I then installed the &#8220;API Demos&#8221; app from here: <a href="http://developer.android.com/resources/samples/ApiDemos/index.html">http://developer.android.com/resources/samples/ApiDemos/index.html</a></p>
<p>Interesting things to note about the API Demo&#8217;s is the features that work in the emulator and those that don&#8217;t.  Like the camera based view had a demo video going, and the voice recognition part didn&#8217;t work.</p>
<p>Next up is what I hope is my first app for the Android, a Pantry Management System that will use the ZXing Barcode scanner API and allow you to catalog your pantry easily.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kilometer0.com/blog/2009/12/28/hello-droid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mate Presentation at NYFLEXUG</title>
		<link>http://www.kilometer0.com/blog/2009/12/20/mate-presentation-at-nyflexug/</link>
		<comments>http://www.kilometer0.com/blog/2009/12/20/mate-presentation-at-nyflexug/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 22:51:19 +0000</pubDate>
		<dc:creator>Alexandru Petrescu</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[mate]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://www.kilometer0.com/blog/?p=46</guid>
		<description><![CDATA[On October 22nd, 2009, I gave a presentation on the Mate Flex Framework to the NY Flex User&#8217;s Group.  Below are my slides and demo application (with source). Source: http://www.kilometer0.com/blog/wp-content/uploads/2009/12/Mate_NYFlexUG.zip *note* I didn&#8217;t make the diagrams. They were created by another blogger (whom I can&#8217;t seem to find at this moment). They were used without [...]]]></description>
			<content:encoded><![CDATA[<p>On October 22nd, 2009, I gave a presentation on the Mate Flex Framework to the NY Flex User&#8217;s Group.  <span id="more-46"></span> Below are my slides and demo application (with source).</p>
<p><img style="visibility: hidden; width: 0px; height: 0px;" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyNjEyODI5NTI4MjYmcHQ9MTI2MTI4Mjk3MjMyOSZwPTEwMTkxJmQ9bGlzc19zdl9zaGFyZV8wJmc9MSZvPWNiMmJiYTA3ZDg3YTQwOGU4MWIwZjIzZmU*OWRmOWMxJm9mPTA=.gif" border="0" alt="" width="0" height="0" /></p>
<div style="width: 425px; text-align: left;"><object style="margin: 0px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=nyflexugmate-091219221613-phpapp02&amp;stripped_title=mate-presentation-given-to-ny-flex-users-group" /><param name="allowfullscreen" value="true" /><embed style="margin: 0px;" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=nyflexugmate-091219221613-phpapp02&amp;stripped_title=mate-presentation-given-to-ny-flex-users-group" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>
<object width="600" height="600">
<param name="movie" value="http://www.kilometer0.com/blog/wp-content/uploads/2009/12/Mate_NYFlexUG.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="allowFullScreen" value="true"></param>
<embed type="application/x-shockwave-flash" width="600" height="600" src="http://www.kilometer0.com/blog/wp-content/uploads/2009/12/Mate_NYFlexUG.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" allowFullScreen="true" ></embed>
</object>
</p>
<p><em>Source: </em><a title="Source" href="http://www.kilometer0.com/blog/wp-content/uploads/2009/12/Mate_NYFlexUG.zip">http://www.kilometer0.com/blog/wp-content/uploads/2009/12/Mate_NYFlexUG.zip</a></p>
<p><em> *note* I didn&#8217;t make the diagrams.  They were created by another blogger (whom I can&#8217;t seem to find at this moment).  They were used without permission, so if you are the rightful owner and would like me to add attribution or remove the diagrams, let me know.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kilometer0.com/blog/2009/12/20/mate-presentation-at-nyflexug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
