<?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>Jozef Chúťka&#039;s blog</title>
	<atom:link href="http://blog.yoz.sk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yoz.sk</link>
	<description>My life, my work</description>
	<lastBuildDate>Thu, 18 Apr 2013 14:33:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>LG Smart TV Emulator From Command Line</title>
		<link>http://blog.yoz.sk/2013/04/lg-smart-tv-emulator-from-command-line/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lg-smart-tv-emulator-from-command-line</link>
		<comments>http://blog.yoz.sk/2013/04/lg-smart-tv-emulator-from-command-line/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 12:15:57 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[LG TV]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[LG]]></category>
		<category><![CDATA[TV]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3333</guid>
		<description><![CDATA[If you wonder if there is a way to run or debug your LG Smart TV application outside of LG IDE, lets say from command line (or Ant), I have some good news for you. It took me some time to discover the necessary requirements but thanks to WMIC and some luck I was able [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/lgsmarttvcommandline.jpg" alt="lgsmarttvcommandline" width="200" height="100" class="alignleft size-full wp-image-3338" /></p>
<p>If you wonder if there is a way to run or debug your LG Smart TV application outside of LG IDE, lets say from command line (or Ant), I have some good news for you. It took me some time to discover the necessary requirements but thanks to <a href="http://technet.microsoft.com/en-us/library/bb742610.aspx">WMIC</a> and some luck I was able to run and debug the app in emulator with the web inspector.</p>
<p>Requirement for this process is to have <a href="http://developer.lge.com/">LG SDK/IDE</a> including Emulator properly installed. Natively LG IDE (eclipse) handles the process of running or debugging the app in emulator pretty smooth. Once you click run or debug button the eclipse starts local server listening on port 8080 (root is c:/*ECLIPSE-WORKSPACE*/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/*PROJECT*/), starts Safari (installed with LG SDK) within a debug perspective and opens an emulator&#8230;</p>
<p><span id="more-3333"></span></p>
<p>All of these steps can be done manualy from command line:</p>
<ul>
<li>lets consider you already have an local server installed, keep in mind that emulator can target your local server at IP <strong>10.0.2.2</strong></li>
<li>Web inspector is a javascript application (part of LG SDK) that can remotely listen and debug a html app running in emulator. You can run it as simple as open it in any browser (chrome worked for me)</li>
<li>emulator is an executable file that takes some arguments</li>
</ul>
<h3>Run In Emulator</h3>
<p>To run the application in emulator use following .bat</></p>
<pre class="brush: plain; title: ; notranslate">SET &quot;SDK_PATH=C:/Program Files (x86)/LG_Smart_TV_SDK&quot;
SET APP_PATH=http://google.com

&quot;%SDK_PATH%/Resources/jre64/launch4j-tmp/LG_Smart_TV_Emulator_2013.exe&quot; ^
-classpath &quot;%SDK_PATH%/LG_Smart_TV_Emulator_2013/LG_Smart_TV_Emulator_2013.exe;.;lib/vboxjmscom_4.1.jar;lib/vboxjmscom_4.2.jar;lib/jacob.jar;lib/commons-compress-1.3.jar;lib/log4j-1.2.16.jar&quot; ^
com.dtvsdk.emul.VmEmulatorManager -b ^
%APP_PATH%</pre>
<h3>Debug In Emulator</h3>
<p>Prior being able to use web inspector console for debugging javascript, you need to download <a href="http://jwebsocket.org/">jWebSocket</a> and run it with proper config.</p>
<ol>
<li>visit <a href="http://jwebsocket.org/">jwebsocket.org</a> and download &#8220;Server&#8221; version</li>
<li>unzip somewhere on your drive</li>
<li>merge default jWebServer/conf/jWebServer.xml config file with the one from LG_Smart_TV_SDK/Resources/jWebSocket-1.0/conf/jWebServer.xml</li>
<li>run jWebServer</li>
<li>run web inspector</li>
<li>run emulator</li>
</ol>
<p>It seems to be sufficient to merge following lines in default jWebServer.xml file:</p>
<p>somewhere around lne 110 add</p>
<pre class="brush: plain; title: ; notranslate">&lt;domain&gt;null&lt;/domain&gt;
&lt;domain&gt;file://*&lt;/domain&gt;
&lt;domain&gt;http*://*&lt;/domain&gt;</pre>
<p>line 906, 910</p>
<pre class="brush: plain; title: ; notranslate">&lt;loginname&gt;LG_IDE&lt;/loginname&gt;
&lt;password&gt;LG_IDE&lt;/password&gt;</pre>
<p>line 921, 924 replace</p>
<pre class="brush: plain; title: ; notranslate">&lt;loginname&gt;LG_DTV&lt;/loginname&gt;
&lt;password&gt;LG_DTV&lt;/password&gt;</pre>
<p>Now run the jWebServer with following attributes</p>
<pre class="brush: plain; title: ; notranslate">SET &quot;SDK_PATH=C:/Program Files (x86)/LG_Smart_TV_SDK&quot;
SET &quot;JWEBSOCKET_PATH=c:/Program Files (x86)/jWebSocket/jWebSocket-1.0&quot;

java -jar &quot;%JWEBSOCKET_PATH%/libs/jWebSocketServer-1.0.jar&quot; ^
-home &quot;%JWEBSOCKET_PATH%&quot; ^
-bootstrap &quot;%SDK_PATH%\Resources\jWebSocket-1.0\conf\Resources\bootstrap.xml&quot; ^
-config jWebSocket.xml</pre>
<p>To debug the application in emulator using web inspector use:</p>
<pre class="brush: plain; title: ; notranslate">SET &quot;SDK_PATH=C:/Program Files (x86)/LG_Smart_TV_SDK&quot;
SET APP_PATH=http://10.0.2.2/your/app/index.html

&quot;%SDK_PATH%/Resources/LGInspectorForIDE/NetCast4/inspector.html&quot;

&quot;%SDK_PATH%/Resources/jre64/launch4j-tmp/LG_Smart_TV_Emulator_2013.exe&quot; ^
-classpath &quot;%SDK_PATH%/LG_Smart_TV_Emulator_2013/LG_Smart_TV_Emulator_2013.exe;.;lib/vboxjmscom_4.1.jar;lib/vboxjmscom_4.2.jar;lib/jacob.jar;lib/commons-compress-1.3.jar;lib/log4j-1.2.16.jar&quot; ^
com.dtvsdk.emul.VmEmulatorManager -d ^
%APP_PATH%</pre>
<p>Once the application runs in emulator, your web inspector console should be able to connect. Basicaly you can remotely debug any html app running in emulator with web inspetor (e.g. google.com). For debugging the app on real TV device it may require some different steps but I will cover that in another blog post.</p>
<p>Where to go from here:</p>
<ul>
<li><a href="https://www.webkit.org/blog/1620/webkit-remote-debugging/">WebKit Remote Debugging</a></li>
<li><a href="https://www.webkit.org/blog/1875/announcing-remote-debugging-protocol-v1-0/">Remote Debugging Protocol v1.0</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2013/04/lg-smart-tv-emulator-from-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samsung Smart TV Development with HaXe and MVC</title>
		<link>http://blog.yoz.sk/2013/03/samsung-smart-tv-development-with-haxe-and-mvc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=samsung-smart-tv-development-with-haxe-and-mvc</link>
		<comments>http://blog.yoz.sk/2013/03/samsung-smart-tv-development-with-haxe-and-mvc/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 12:23:41 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[HaXe]]></category>
		<category><![CDATA[Samsung TV]]></category>
		<category><![CDATA[Inject]]></category>
		<category><![CDATA[IoC]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Signals]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3323</guid>
		<description><![CDATA[Next step with my project was to implement MVC framework. The most popular one called mmvc provided by massive interactive seemed a bit broken when used with HaXe 3 RC, but as all those sources are available, I managed to do some small updates in order to compile it without errors. Normaly you would just [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/haxemvc.png" alt="haxemvc" width="200" height="100" class="alignleft size-full wp-image-3327" /></p>
<p>Next step with my project was to implement MVC framework. The most popular one called <a href="https://github.com/massiveinteractive/mmvc">mmvc</a> provided by <a href="https://github.com/massiveinteractive">massive interactive</a> seemed a bit broken when used with HaXe 3 RC, but as all those sources are available, I managed to do some small updates in order to compile it without errors. Normaly you would just install the mmvc library using <a href="http://haxe.org/haxelib">haxelib</a> and the install process grabs the necessary dependencies like <a href="https://github.com/massiveinteractive/msignal">msignal</a>, <a href="https://github.com/massiveinteractive/minject">minject</a>, mcover, mcore&#8230; But in order to fix HaXe 3 issues, I decided to just download it into my projects src folder.</p>
<p><span id="more-3323"></span></p>
<p>mmvc reuse a lot of patterns and naming conventions from <a href="http://www.robotlegs.org/">RobotLegs</a> framework I believe all ActionScript 3 developers are familiar with already. However, events has been completely replaced by signals. Signals are as well rewritten from its <a href="https://github.com/robertpenner/as3-signals">ActionScript brother</a>. You can also benefit from dependency injections using <a href="http://haxe.org/manual/metadata">HaXe metadata</a>.</p>
<p>Once I got rid of compilation errors regarding <a href="http://haxe.org/manual/haxe3/migration">HaXe 3 compiler changes</a>, everything ran smooth out of the box for my JavaScript project on emulator as well as on TV device. One thing that was not that obvious was signal mapping within context, e.g. if you map signal into a command</p>
<pre class="brush: plain; title: ; notranslate">commandMap.mapSignalClass(DemoSignal, DemoSignalCommand);</pre>
<p>Then you have to make sure you use the injected DemoSignal instance in your mediator:</p>
<pre class="brush: plain; title: ; notranslate">class MainViewMediator extends Mediator&lt;MainView&gt;
{
	@inject
	public var demoSignal:DemoSignal;
	
	override function onRegister()
	{
		super.onRegister();
		
		//demoSignal.completed.add(onSignalCompleted);
		demoSignal.dispatch();
	}
}</pre>
<p>It is also suggested to have a completed property-signal in your signal class in order to get notified once the command has executed the signal. I guess this may result in some issues in case you reuse the signal in multiple mediators.</p>
<p>There is an <a href="https://github.com/massiveinteractive/mmvc/tree/master/example">example project</a> provided with mmvc repository that will help you get started. You can find my <a href="https://github.com/jozefchutka/SamsungSmartTVSDKHaXe">project sources including updated mmvc sources</a> in the repository. Make sure to checkout for latest changes from original repos.</p>
<p>Where to go from here:</p>
<ul>
<li><a href="https://github.com/massiveinteractive/mmvc">mmvc</a> &#8211; HaXe IOC framework utilizing Signals and macro based injectionk</li>
<li><a href="https://github.com/massiveinteractive/msignal">msignal</a> &#8211; HaXe port of the ActionScript 3 Signals library that leverages Haxe type parameters.</li>
<li><a href="https://github.com/massiveinteractive/minject">minject</a> &#8211; HaXe port of the ActionScript 3 SwiftSuspenders IOC library with efficient macro enhanced type reflection</li>
<li><a href="http://www.robotlegs.org/">RobotLegs</a> &#8211; an ActionScript Application Framework. It offers: Dependency, Module, Command and View management.</li>
<li><a href="https://github.com/robertpenner/as3-signals">Signals</a> &#8211; ActioScript approach for AS3 events, inspired by C# events and signals/slots in Qt</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2013/03/samsung-smart-tv-development-with-haxe-and-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing HaXe JavaScript Project</title>
		<link>http://blog.yoz.sk/2013/03/unit-testing-haxe-javascript-project/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unit-testing-haxe-javascript-project</link>
		<comments>http://blog.yoz.sk/2013/03/unit-testing-haxe-javascript-project/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 16:02:21 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[HaXe]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Samsung TV]]></category>
		<category><![CDATA[JUnitReport]]></category>
		<category><![CDATA[unit tests]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3305</guid>
		<description><![CDATA[Today I continued to progress on my Samsung Smart TV project with unit test implementation. My aim is to prepare smooth process for automated builds. First, I tought I would struggle with it much more but at the end it appeared that necessary tools already exists. My first sreps led me to &#8220;Writing Unit Tests&#8221; [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/haxeunit.png" alt="haxeunit" width="200" height="100" class="alignleft size-full wp-image-3307" /></p>
<p>Today I continued to progress on my <a href="http://blog.yoz.sk/2013/03/samsung-smart-tv-development-with-haxe/">Samsung Smart TV</a> project with unit test implementation. My aim is to prepare smooth process for automated builds. First, I tought I would struggle with it much more but at the end it appeared that necessary tools already exists. </p>
<p>My first sreps led me to &#8220;<a href="http://haxe.org/doc/cross/unit">Writing Unit Tests</a>&#8221; article about resources available directly with HaXe, however it seemed that JavaScript testing was not available. The article also referenced <a href="http://lib.haxe.org/p/munit">MUnit</a> a cross-platform haxe unit testing framework, which looked to have more capabilities.</p>
<p><span id="more-3305"></span></p>
<p><a href="https://github.com/massiveinteractive/MassiveUnit">MassiveUnit</a> is a metadata driven unit testing framework for cross-platform Haxe development  and it pretty much covers all the functionality I need. Kudos to <a href="https://github.com/massiveinteractive">MassiveInteractive</a> for contributing so much for HaXe community. I am not going to explain how to <a href="https://github.com/massiveinteractive/MassiveUnit/wiki">get started with MUnit</a> or how to <a href="https://github.com/massiveinteractive/MassiveUnit/wiki/Compiling-and-running-tests">compile and run tests</a> as it is well described in wiki and on some other <a href="http://blog.pixelami.com/2012/05/haxe-unit-testing-with-munit/">webs</a>. But I will rather share some of my findings, and best practices I decided to use for continous integration.</p>
<p>It seems that MUnit requires both <strong>test.hxml</strong> and <strong>.munit</strong> config files to exist prior running unit tests. But while I do not want to have configs in any other place than build.xml, I decided to generate these dynamicaly. MUnit can dynamically create config for you so lets do some Ant:</p>
<pre class="brush: xml; title: ; notranslate">&lt;exec executable=&quot;haxelib&quot;&gt;
	&lt;arg value=&quot;run&quot;/&gt;
	&lt;arg value=&quot;munit&quot;/&gt;
	&lt;arg value=&quot;config&quot;/&gt;
	&lt;arg value=&quot;-src&quot;/&gt;&lt;arg value=&quot;src/test/haxe&quot;/&gt;
	&lt;arg value=&quot;-bin&quot;/&gt;&lt;arg value=&quot;${TARGET_TEST}&quot;/&gt;
	&lt;arg value=&quot;-report&quot;/&gt;&lt;arg value=&quot;${TARGET_TEST}/report&quot;/&gt;
	&lt;arg value=&quot;-classPaths&quot;/&gt;&lt;arg value=&quot;src/main/haxe,../lib&quot;/&gt;
	&lt;arg value=&quot;-hxml&quot;/&gt;&lt;arg value=&quot;test.hxml&quot;/&gt;
&lt;/exec&gt;</pre>
<p>&#8230;but it generates some Example* files I am not interested in testing:</p>
<pre class="brush: xml; title: ; notranslate">&lt;delete file=&quot;src/test/haxe/ExampleTest.hx&quot;/&gt;</pre>
<p>&#8230;so once I have only stuff I need in my classPath, lets test:</p>
<pre class="brush: xml; title: ; notranslate">&lt;exec executable=&quot;haxelib&quot;&gt;
	&lt;arg value=&quot;run&quot;/&gt;
	&lt;arg value=&quot;munit&quot;/&gt;
	&lt;arg value=&quot;test&quot;/&gt;
	&lt;arg value=&quot;-js&quot;/&gt;
	&lt;arg value=&quot;-kill-browser&quot;/&gt;
&lt;/exec&gt;</pre>
<p>My project is JavaScript only so we can filter target by <strong>-js</strong> flag, and the automated build machine should close testing browser (tab) once done &#8211; resolved by <strong>-kill-browser</strong>. Ok, still some files left I am not interested in versioning:</p>
<pre class="brush: xml; title: ; notranslate">&lt;delete file=&quot;src/test/haxe/TestSuite.hx&quot;/&gt;
&lt;delete file=&quot;test.hxml&quot;/&gt;
&lt;delete file=&quot;.munit&quot;/&gt;</pre>
<p>&#8230;and finally break Ant if tests failed:</p>
<pre class="brush: xml; title: ; notranslate">&lt;fail message=&quot;Tests failed&quot;&gt;
	&lt;condition&gt;
		&lt;resourcecontains resource=&quot;${TARGET_TEST}/report/test/results.txt&quot; substring=&quot;FAILED&quot;/&gt;
	&lt;/condition&gt;
&lt;/fail&gt;</pre>
<p>As our CI management system plays nice with JUnit, lets update generated TestMain.hx file</p>
<pre class="brush: plain; title: ; notranslate">public function new()
{
	var suites = new Array&lt;Class&lt;massive.munit.TestSuite&gt;&gt;();
	suites.push(TestSuite);
	
	var runner:TestRunner = new TestRunner(new RichPrintClient());
	runner.addResultClient(new HTTPClient(new JUnitReportClient()));
	runner.completionHandler = completionHandler;
	runner.run(suites);
}</pre>
<p>so it produces formatted results in:</p>
<pre class="brush: plain; title: ; notranslate">test/report/test/junit/js/xml/TEST-sk.yoz.tv.samsung.demo.test.SomeTest.xml</pre>
<p>All the sources are available on <a href="https://github.com/jozefchutka/SamsungSmartTVSDKHaXe/tree/tests">github tag tests</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2013/03/unit-testing-haxe-javascript-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samsung Smart TV Development With HaXe</title>
		<link>http://blog.yoz.sk/2013/03/samsung-smart-tv-development-with-haxe/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=samsung-smart-tv-development-with-haxe</link>
		<comments>http://blog.yoz.sk/2013/03/samsung-smart-tv-development-with-haxe/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 15:38:30 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[HaXe]]></category>
		<category><![CDATA[Samsung TV]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Samsung]]></category>
		<category><![CDATA[TV]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3269</guid>
		<description><![CDATA[You have propably already heard about smart TVs can run applications. However, the app market is very fragmented, some vendors support AIR apps or Flash Player but the runtime versions are just too old, so HTML apps seems to be a better solution these days. Decision has been made and my next project is going [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/haxesamsung.png" alt="haxesamsung" width="200" height="100" class="alignleft size-full wp-image-3290" /></p>
<p>You have propably already heard about smart TVs can run applications. However, the app <a href="http://www.noriste.com/smart-tvs-a-fast-2012-recap/">market is very fragmented</a>, some vendors support AIR apps or Flash Player but the runtime versions are just too old, so HTML apps seems to be a better solution these days. Decision has been made and my next project is going to be HTML/JavaScript based Samsung smart TV app and I need to prepare comfort environment to work in (click and run just like Flash Builder does). I have doubts that language like JavaScript by its nature can be easily used on enterprise projects, where multiple team members cooperate and it seems like <a href="http://blog.xero.com/2013/03/making-mobile-work/">numbers of apps</a> already <a href="http://techcrunch.com/2012/09/11/mark-zuckerberg-our-biggest-mistake-with-mobile-was-betting-too-much-on-html5/">struggled to see a daylight</a>. Luckily, there are languages like <a href="http://haxe.org/">HaXe</a>, that compiles into clean JavaScript while still offering advanced features like strong typing. In this article, I would like to share my initial steps and successes with Samsung project on HaXe.</p>
<p><span id="more-3269"></span></p>
<h3>Samsung SDK</h3>
<p>First steps led me to download and install <a href="https://www.samsungdforum.com/Devtools/SdkDownload">Samsung SDK</a>. I was prompted to install <strong>DirectX End-User Runtime</strong> (search on google) during the SDK installation. Both installs went smooth. At the end I was requested to install apache server but I already had one http service installed so I skipped. Local server is necessary just in order to install the app into TV device. Samsung SDK contains TV emulator and an Eclipse with some custom plugins allowing you to run and debug TV app on emulator or package the app for release to a device. The catch with emulator is, the real TV device works a bit different than emulator and some sdk APIs would just not work.</p>
<p>Samsung does a good job with docummentation, you just have to get used with the navigation. E.g. as of today they list <a href="https://www.samsungdforum.com/Guide/">263 guide documents</a> (Resource / API reference / SEF Plugin API / Player) and tutorials usualy with examples (Resource / Tutorial). Also a lot of APIs is being discussed on <a href="http://www.samsungdforum.com/SamsungDForum/index">forum</a>.</p>
<p>What I was interested was, what APIs my dev device (UE55D7000) supports. Here is a nice <a href="http://www.samsungdforum.com/Devtools/Spec">platform features table</a>, but in order to find out what type (year) my device was I had to <a href="http://www.samsungdforum.com/SamsungDForum/ForumView/7e2b7fa90012098b?forumID=15e27a0e911ebc0c">deserialize the model info</a>:</p>
<blockquote><p>Device model usually like this ==> UA 55 ES 8000<br />
- &#8216;U&#8217; more likely device type (LED/LCD/Plasma) Plasma use &#8216;P&#8217;<br />
- &#8216;A&#8217; more likely the region of device, mine is &#8216;A&#8217; (Asia i think) and some in Europe and USA use &#8216;E&#8217;<br />
- 55 is the TV Inch, in BD player you won&#8217;t see this code above, only E5900 for example<br />
- &#8216;E&#8217; is the device release year, E = 2012, D = 2011, C = 2010, and latest F = 2013<br />
- &#8216;S&#8217; is just the flag to show this is Slim model<br />
- 8000 is the device series and if in the market, Series 8 means the leading number there &#8217;8&#8217;000, ES7500 is Series 7</p></blockquote>
<p>According to this, my device should be able to play PlayReady protected media (no smooth streaming though), but after spending 3 days failing to play any video with PlayReady DRM, even those examples on forum or creating it according to <a href="http://www.samsungdforum.com/Common/FileDownLoad?BoardType=6b8cf359de61b749&#038;fileID=ca938dc3eae08395">official tutorial</a>, I started to think the device is just not capable. If you have any idea why I am failing, <a href="http://www.samsungdforum.com/SamsungDForum/ForumView/fc9db838bc1a1dd3?forumID=40f9dc042e831178">please let me know</a>.</p>
<p>Working with Eclipse is pretty much smooth:</p>
<ol>
<li>create samsung project from top menu Samsung: Smart TV SDK / Create &#8230;</li>
<li>select project folder in package explorer and click run or debug app on emulator icons &#8230;</li>
<li>once you want to test your app on a real device, you have to <a href="http://www.samsungdforum.com/upload_files/files/guide/data/html/html_3/getting_started/test_app_on_tv.html">follow some cofig steps</a>, then click package icon, and install the app on the TV.</li>
</ol>
<h3>HaXe</h3>
<p>I have already used HaXe some time ago, so I was able to catch faster with this. Also installing it is pretty smooth, just <a href="http://haxe.org/download">downloaded HaXe 3.0 RC</a> and followed the instructions. Previously I used HaXe with <a href="http://www.flashdevelop.org/">FlashDevelop</a>, where it has better support. But now I was interested to integrate it with Samsung Eclipse using <a href="http://www.eclihx.org/">eclihx</a> (HaXe plugin). Its not perfect and seems to be a bit outdated, however it still seems to work for some code completion and compilation.</p>
<h3>Merging</h3>
<p>So I was able to create Samsung Smart TV project with fancy run, debug, package buttons or HaXe project with compile button, but I wanted both at the same time! No problem for eclipse. My plan was to stick with HaXe / eclihx project (so I have autocompletion) while creating some external build configuration for running, debugging and packaging the project for emulator and device. As the Samsung Eclipse seems to be a port of some basic Eclipse and misses <a href="http://ant.apache.org/">Ant</a> I needed for some automation, I had to install it first:</p>
<ol>
<li>click Help / Install New Software</li>
<li>chose work with &#8220;Indigo &#8211; http://download.eclipse.org/releases/indigo&#8221;</li>
<li>expand &#8220;Web, XML, Java EE&#8230;&#8221; option</li>
<li>select &#8220;Eclipse Java EE Developer Tools&#8221;</li>
<li>and finish the install process</li>
<li>Ant is now installed in eclipse</li>
</ol>
<p>I have created a Sample eclihx project while switched back to &#8220;Samsung Smart TV Perspective&#8221; as this one contains &#8220;run&#8221; button I need for my one-click operations.</p>
<p><img src="http://blog.yoz.sk/wp-content/uploads/runbutton.png" alt="runbutton" width="738" height="298" class="alignnone size-full wp-image-3278" /></p>
<p>In order to compile HaXe with ant, I have installed <a href="http://haxe.org/com/libs/anthx">AntHX</a> using command line:</p>
<pre class="brush: plain; title: ; notranslate">haxelib install anthx</pre>
<p>I have created a build.xml file that would compile the HaXe sources, using AntHX taskdef. Then created external build:</p>
<ol>
<li>clicked Run / External Tools / External Tools Configuration</li>
<li>created new Ant Build</li>
<li>added AntHX.jar into classpath</li>
</ol>
<p><img src="http://blog.yoz.sk/wp-content/uploads/anthxclasspath.png" alt="anthxclasspath" width="706" height="285" class="alignnone size-full wp-image-3286" /></p>
<p>Thing I was still missing was the ability to run Samsung emulator with my app from ant. Emulator is an .exe-cutable installed with Samsung SDK, but while Samsung doccumentation says nothing about emulator command line arguments, the dark magic windows-fu came handy especialy command <a href="http://technet.microsoft.com/en-us/library/bb742610.aspx">WMIC</a>. I used the original Samsung project and clicked run-in-emulator button to make the emulator open, then <a href="http://windowsxp.mvps.org/listproc.htm">executed WMIC</a>:</p>
<pre class="brush: plain; title: ; notranslate">WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid</pre>
<p>to find out that emulator was executed with following arguments:</p>
<pre class="brush: plain; title: ; notranslate">&quot;C:\Program Files (x86)\Samsung\Samsung TV SDK 4\Emulator\Emulator2013_v4\bin\Emulator2.exe&quot; kEclipse &quot;_temp_20100108_&quot;
&quot;C:\Program Files (x86)\Samsung\Samsung TV SDK 4\Emulator\Emulator2013_v4\bin\Emulator2.exe&quot; kEclipseWI &quot;_temp_20100108_&quot;</pre>
<p>Now I was able to finish the ant script with targets for running and debugging in emulator and I have also implemented package target for one-click packaging (nothing else then zipping sources), instad of using the original packaging button. At the end of the day, Ant script is able to:</p>
<ul>
<li>compile HaXe sources</li>
<li>run the project in emulator</li>
<li>debug the project in emulator</li>
<li>package the app</li>
<li>depploy the app (to http server, to be installed on device)</li>
</ul>
<p>I have commited my <a href="https://github.com/jozefchutka/SamsungSmartTVSDKHaXe">Sample project with build.xml on github</a> for my future reference and for anyone who is interested using HaXe for Samsung Smart TV development. I have also started to create some HaXe externs for samsung SDK APIs, and I will add more when needed.</p>
<p>Where to go from here</p>
<ul>
<li><a href="http://www.samsungdforum.com/">Samsung Forum</a></li>
<li><a href="https://groups.google.com/forum/?hl=en#!forum/haxelang">HaXe Community</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2013/03/samsung-smart-tv-development-with-haxe/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Key Hash For Facebook Android Application in AIR</title>
		<link>http://blog.yoz.sk/2013/02/quick-tipkey-hash-for-facebook-android-application-in-air/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quick-tipkey-hash-for-facebook-android-application-in-air</link>
		<comments>http://blog.yoz.sk/2013/02/quick-tipkey-hash-for-facebook-android-application-in-air/#comments</comments>
		<pubDate>Fri, 08 Feb 2013 10:43:27 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Cert]]></category>
		<category><![CDATA[Keytool]]></category>
		<category><![CDATA[RSA]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3257</guid>
		<description><![CDATA[It may be a little tricky to setup &#8220;Native Android App&#8221; section for your Facebook application. Especially the field &#8220;Key Hashes&#8221;. Facebook provides instructions for acquiring debug version hash but is not very clear about how to get one for signed application. There is a lot of valid answers around the internet, but the one [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/facebookcert.png" alt="facebookcert" width="200" height="100" class="alignleft size-full wp-image-3260" /></p>
<p>It may be a little tricky to setup &#8220;Native Android App&#8221; section for your <a href="https://developers.facebook.com">Facebook application</a>. Especially the field &#8220;Key Hashes&#8221;. <a href="https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/">Facebook provides</a> instructions for acquiring debug version hash but is not very clear about how to get one for signed application. There is <a href="http://stackoverflow.com/questions/4388992/key-hash-for-android-facebook-app">a lot of</a> <a href="http://stackoverflow.com/questions/12082084/how-do-i-retrieve-an-apk-keyhash-for-facebook-sso">valid answers</a> around the internet, but the one I needed was still missing. Imagine this simple scenario where you export and sign (using .p12 cert) your AIR Android project, you have an .apk file and want to get a key hash for facebook. Then I finally <a href="http://stackoverflow.com/questions/5313991/how-to-retrieve-a-signature-hash-for-facebook-from-a-public-private-key-pair">found the answer</a>:</p>
<p><span id="more-3257"></span></p>
<ol>
<li>Unzip .apk file and extract META-INF\CERT.RSA file</li>
<li>run <strong>keytool -printcert -file CERT.RSA</strong></li>
<li>notice SHA1 bytes are printed like <strong>29:37:F1:CB:06&#8230;</strong></li>
<li>copy SHA1 bytes into <a href="http://tomeko.net/online_tools/hex_to_base64.php">HEX to BASE64</a> converter</li>
<li>see your BASE64 key hash in output field</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2013/02/quick-tipkey-hash-for-facebook-android-application-in-air/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing Train Lord</title>
		<link>http://blog.yoz.sk/2012/11/introducing-train-lord/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=introducing-train-lord</link>
		<comments>http://blog.yoz.sk/2012/11/introducing-train-lord/#comments</comments>
		<pubDate>Fri, 02 Nov 2012 13:03:31 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[MMOG]]></category>
		<category><![CDATA[OpenStreetMap]]></category>
		<category><![CDATA[Starling]]></category>
		<category><![CDATA[Train Lord]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3218</guid>
		<description><![CDATA[Train Lord is a live massively multiplayer game (MMOG) using real world data and maps. The goal is simple. Become the richest lord in the world by buying rails, stations, trains, creating rail sets and dispatching trains. I have been developing this game and learning a lot of technologies to put all the stuff together [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/200x100.png" alt="" title="200x100" width="200" height="100" class="alignleft size-full wp-image-3219" /></p>
<p><a href="http://trainlord.com">Train Lord</a> is a live massively multiplayer game (<a href="http://en.wikipedia.org/wiki/Massively_multiplayer_online_game">MMOG</a>) using real world data and maps. The goal is simple. Become the richest lord in the world by buying rails, stations, trains, creating rail sets and dispatching trains. I have been developing this game and learning a lot of technologies to put all the stuff together since February 2012. Starting November I was able to release the first version live. <a href="http://trainlord.com">Click here to play</a>, here to see <a href="http://trainlord.com/help.html">help page</a>, or here for <a href="https://www.facebook.com/TrainLord">Communuty page</a>. I would like to describe and give credits to some technologies I have used, so it may help other developers as well as myself somewhere in the future <img src='http://blog.yoz.sk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p><span id="more-3218"></span></p>
<p>First, I would like to share gameplay / manual screencast video with captions. In this video you can see the main objectives you have to accomplish in order to rule the game.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/RUoPHp79vM4" frameborder="0" allowfullscreen></iframe></p>
<h3>Client</h3>
<p>The client application (game) was completly written in ActionScript. I am using a <a href="http://flex.org">Flex framework</a> for ui components and for performance reasons I write directly .as (no .mxml) even for components and skins.</p>
<p>I have utilized my <a href="http://ycanvas.yoz.sk">YCanvas</a> project &#8211; an open source ActionScript 3 library that provides stage3D (GPU) engine for perfectly overlapping grid based zooming projects like world maps or <a href="http://onboard.yoz.sk">onBoard</a> or simply a tile maps renderer.</p>
<p>YCanvas is based on <a href="http://gamua.com/starling/">Starling</a> &#8211; The Open Source Game Engine for Flash. Using stage3D you can achieve really smooth 60fps gaming experience.</p>
<p>Once experienced I never start a project with IoC other than <a href="http://www.robotlegs.org/">Robotlegs</a> &#8211; a pure AS3 micro-architecture (framework) with a light footprint and limited scope. Simply put, Robotlegs is there to help you wire your objects together. It provides the glue that your application needs to easily function in a decoupled way. Through the use of automated metadata based dependency injection Robotlegs removes boilerplate code in an application.</p>
<p>Most of the eventing is handled by <a href="https://github.com/robertpenner/as3-signals">Signals</a> &#8211; a new approach for AS3 events, inspired by C# events and signals/slots in Qt.</p>
<p>A great lightweight and fast tweening lib you all already know is from <a href="https://www.greensock.com/">Greensock</a>.</p>
<p>While looking for train models all over the internet I found there are a lot of available already for <a href="http://en.wikipedia.org/wiki/MSTS">Microsoft Train Simulator</a> created by indie modellers. Here are some of them in Czech Republic doing a great job &#8211; <a href="http://skura.msts.cz/">Skura</a>, <a href="http://duuso.demmsts.sk/">Duuso</a>, <a href="http://msts.jacek-modely.cz/">Jacek</a>, <a href="http://ondraj-msts.ic.cz/">Ondraj</a>, <a href="http://eldar.cz/kank/">Kank</a>&#8230;</p>
<p>As I only needed a top view and a side view, I used <a href="http://msts.steam4me.net/utilities/shape_viewer.html">Shape Viewer</a> &#8211; displays an entire shape on screen without having to load up MSTS itself enabling you to examine the entire model and lets you see exactly what it looks like in the sim.</p>
<p>As often as I work with services I always use <a href="http://www.charlesproxy.com/">Charles Proxy</a> &#8211; an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and SSL / HTTPS traffic between their machine and the Internet. This includes requests, responses and the HTTP headers (which contain the cookies and caching information). If you have not had the pleasure to meet this tool, now its right time to do so.</p>
<h3>Server</h3>
<p>The game uses a real world data from <a href="http://www.openstreetmap.org/">OpenStreetMap</a> project, especialy I took advantage of <a href="http://wiki.openstreetmap.org/wiki/Planet.osm">Planet.osm</a> &#8211; an XML file that contains all the data you can see on the generated maps (streets, buildings, lakes, countries&#8230;). Currently it contains more than 25GB of bz-ed data in total. I recommend downloading the file via torrents from <a href="http://osm-torrent.torres.voyager.hr/files/">torres.voyager.hr</a>.</p>
<p>To parse that much data and extract just rails and stations takes some time. There is a great tool for this called <a href="http://wiki.openstreetmap.org/wiki/Osmosis">Osmosis</a> &#8211; a command line Java application for processing OSM data. The tool consists of a series of pluggable components that can be chained together to perform a larger operation. For example, it has components for reading from database and from file, components for writing to database and to file, components for deriving and applying change sets to data sources, components for sorting data, etc. Even with this tool it takes hours to parse a whole world. There is a way osmosis would pass the data directly into database, but I did not have that luck to make it running.</p>
<p>To put this data from .osm file to a database I tried <a href="http://en.wikipedia.org/wiki/XSL">XSL</a> &#8211; Extensible Stylesheet Language (XSL) is used to refer to a family of languages used to transform and render XML documents. But it soon appeared that it can not handle big files.</p>
<p>So I discovered <a href="http://stx.sourceforge.net/">STX</a> &#8211; Streaming Transformations for XML (STX) is a one-pass transformation language for XML documents. STX is intended as a high-speed, low memory consumption alternative to XSLT, using the W3C XQuery 1.0 and XPath 2.0 Data Model. Since STX does not require the construction of an in-memory tree, it is suitable for use in resource constrained scenarios. Oh yeah this beast can handle 4GB .osm file like nothing!</p>
<p>Once my .osm is parsed into .sql, I use <a href="http://www.mysql.com/">MySQL</a> database to store the data. <a href="http://wiki.openstreetmap.org/wiki/PostgreSQL">OpenStreetMap recomends to use Postgre</a> though.</p>
<p><del datetime="2012-11-07T13:42:08+00:00">To transfer the data to client I decided to use <a href="http://en.wikipedia.org/wiki/Action_Message_Format">AMF</a> &#8211;  a binary format used to serialize objects graphs such as ActionScript objects and XML, or send messages between an Adobe Flash client and a remote service. At first I tried <a href="http://framework.zend.com/manual/1.12/en/zend.amf.html">ZendAMF</a> but I did not get the performance as good as what <a href="http://www.silexlabs.org/amfphp/">AMFPHP</a> provides. It seems this project has been reborn after few years of hibernating.</del> It appeared that none of amf libs in php were capable of handling large datasets and while I ended up exceeding php memory limits too often I decided to switch to JSON gateway.</p>
<p>I decided to implement 3rd party login services so users do not have to create an account (and forget a password every time) when playing. <a href="https://developers.facebook.com/docs/concepts/login/">Facebook</a>, <a href="https://dev.twitter.com/docs/auth/sign-twitter">Twitter</a> and <a href="https://developers.google.com/google-apps/sso/openid_reference_implementation?hl=en">Google</a> logins are implemented for a better comfort and running nicely on the backend.</p>
<p>&#8230; almost forgotten to mention <a href="http://www.geobytes.com/IpLocator.htm">Ip Address Locator</a> &#8211; a service (IP Address Map lookup service) provided by Geobytes, inc to assist you in locating the geographical location of an IP Address. It does the black magic behind locating the initial position on the map &#8211; your home city.</p>
<p>As you can see a lot of technologies were involved to prepare and run the game. And I did not even mention the common ones. Having smooth user experience playing a game with real world data, flash remains to be a perfect technology. I hope you like the game and please leave me some feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2012/11/introducing-train-lord/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Flex Arc Preloader Without SparkDownloadProgressBar</title>
		<link>http://blog.yoz.sk/2012/09/flex-arc-preloader-without-sparkdownloadprogressbar/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=flex-arc-preloader-without-sparkdownloadprogressbar</link>
		<comments>http://blog.yoz.sk/2012/09/flex-arc-preloader-without-sparkdownloadprogressbar/#comments</comments>
		<pubDate>Mon, 10 Sep 2012 12:08:02 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[arc]]></category>
		<category><![CDATA[DownloadProgressBar]]></category>
		<category><![CDATA[IPreloaderDisplay]]></category>
		<category><![CDATA[preloader]]></category>
		<category><![CDATA[SparkDownloadProgressBar]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3210</guid>
		<description><![CDATA[There is a lot of flex preloader tutorials all over the internet. If you take a closer look at each, you may notice those all extends DownloadProgressBar or SparkDownloadProgressBar classes. You may decide that these classes do not fit your needs, and it that case you can extend regular Sprite with IPreloaderDisplay implementation. Soon you [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/preloader.jpg" alt="" title="preloader" width="200" height="100" class="alignleft size-full wp-image-3211" /></p>
<p>There is a lot of <a href="http://www.adobe.com/devnet/flex/articles/flex-custom-preloader.html">flex preloader</a> <a href="http://www.flexer.info/2008/02/07/very-first-flex-preloader-customization/">tutorials</a> <a href="http://stackoverflow.com/questions/7995186/flex-preloader-without-flash-cs">all over the internet</a>. If you take a closer look at each, you may notice those all extends <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/preloaders/DownloadProgressBar.html">DownloadProgressBar</a> or <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/preloaders/SparkDownloadProgressBar.html">SparkDownloadProgressBar</a> classes. You may decide that these classes do not fit your needs, and it that case you can extend regular Sprite with <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/preloaders/IPreloaderDisplay.html">IPreloaderDisplay</a> implementation. Soon you realize there is some other <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/preloaders/Preloader.html">Preloader</a> in use, that communicates with your custom one through events. Following example contains a preloader implementation that renders a filled arc based on application load progress and RSL load progress. Lets have a look how to handle it properly.</p>
<p><span id="more-3210"></span></p>
<p>This is an example of Preloader.as file</p>
<pre class="brush: as3; title: ; notranslate">package sk.yoz.rtw.skins.white.components
{
    import flash.display.Shape;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    
    import mx.events.FlexEvent;
    import mx.events.RSLEvent;
    import mx.preloaders.IPreloaderDisplay;
    
    import sk.yoz.rtw.view.utils.GraphicsUtils;
    
    public class Preloader extends Sprite implements IPreloaderDisplay
    {
        private var progressShape:Shape = new Shape;
        private var _preloader:Sprite;
        
        private var progress:Number = 0;
        private var rslProgress:Number = 0;
        
        public function Preloader()
        {
            super();
            
            addChild(progressShape);
            
            addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
        }
        
        public function get backgroundAlpha():Number
        {
            return 1;
        }
        
        public function set backgroundAlpha(value:Number):void
        {
        }
        
        public function get backgroundColor():uint
        {
            return 0;
        }
        
        public function set backgroundColor(value:uint):void
        {
        }
        
        public function get backgroundImage():Object
        {
            return null;
        }
        
        public function set backgroundImage(value:Object):void
        {
        }
        
        public function get backgroundSize():String
        {
            return &quot;100&quot;;
        }
        
        public function set backgroundSize(value:String):void
        {
        }
        
        public function set preloader(value:Sprite):void
        {
            _preloader = value;
            preloader.root.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
            preloader.addEventListener(RSLEvent.RSL_PROGRESS, onRSLProgress);
            preloader.addEventListener(FlexEvent.INIT_COMPLETE, onInitComplete);
        }
        
        public function get preloader():Sprite
        {
            return _preloader;
        }
        
        public function get stageHeight():Number
        {
            return 0;
        }
        
        public function set stageHeight(value:Number):void
        {
        }
        
        public function get stageWidth():Number
        {
            return 0;
        }
        
        public function set stageWidth(value:Number):void
        {
            
        }
        
        public function initialize():void
        {
        }
        
        // END of interface
        
        private function dispose():void
        {
            preloader.root.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgress);
            preloader.removeEventListener(RSLEvent.RSL_PROGRESS, onRSLProgress);
            preloader.removeEventListener(FlexEvent.INIT_COMPLETE, onInitComplete);
            
            removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
            removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
            
            stage.removeEventListener(Event.RESIZE, onStageResize);
        }
        
        private function draw():void
        {
            var perc:Number = (progress + rslProgress) / 2;
            progressShape.graphics.clear();
            progressShape.graphics.beginFill(0x0, 0.7);
            GraphicsUtils.drawSolidArc(progressShape.graphics, 0, 0, 10, 30, -0.25, perc, perc * 50);
        }
        
        private function center():void
        {
            progressShape.x = stage.stageWidth / 2;
            progressShape.y = stage.stageHeight / 2;
        }
        
        private function onProgress(event:ProgressEvent):void
        {
            progress = event.bytesLoaded / event.bytesTotal;
            draw();
        }
        
        private function onRSLProgress(event:RSLEvent):void
        {
            rslProgress = (event.bytesLoaded / event.bytesTotal) / event.rslTotal
                + (event.rslIndex / event.rslTotal);
            draw();
        }
        
        private function onAddedToStage(event:Event):void
        {
            center();
            removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
            stage.addEventListener(Event.RESIZE, onStageResize);
            addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
        }
        
        private function onRemovedFromStage(event:Event):void
        {
            stage.removeEventListener(Event.RESIZE, onStageResize);
            removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
        }
        
        private function onStageResize(event:Event):void
        {
            center();
        }
        
        private function onInitComplete(event:Event):void
        {
            dispose();
            dispatchEvent(new Event(Event.COMPLETE));
        }
    }
}</pre>
<p>&#8230; drawing arcs with fill inspired by <a href="http://www.pixelwit.com/blog/2008/12/drawing-closed-arc-shape/">PiXELWiT</a>:</p>
<pre class="brush: as3; title: ; notranslate">package sk.yoz.rtw.view.utils
{
    import flash.display.Graphics;
    
    public class GraphicsUtils
    {
        public static function drawSolidArc(graphics:Graphics, centerX:Number,
            centerY:Number, innerRadius:Number, outerRadius:Number, 
            startAngle:Number, arcAngle:Number, steps:uint):void
        {
            // Used to convert angles to radians.
            var twoPI:Number = 2 * Math.PI;
            
            // How much to rotate for each point along the arc.
            var angleStep:Number = arcAngle / steps;
            
            // Variables set later.
            var angle:Number;
            
            // Find the coordinates of the first point on the inner arc.
            var xx:Number = centerX + Math.cos(startAngle * twoPI) * innerRadius;
            var yy:Number = centerY + Math.sin(startAngle * twoPI) * innerRadius;
            
            // Store the coordiantes in an object.
            var startPointX:Number = xx;
            var startPointY:Number = yy;
            
            // Move to the first point on the inner arc.
            graphics.moveTo(xx, yy);
            
            // Draw all of the other points along the inner arc.
            for(var i:uint = 1; i &lt;= steps; i++)
            {
                angle = (startAngle + i * angleStep) * twoPI;
                xx = centerX + Math.cos(angle) * innerRadius;
                yy = centerY + Math.sin(angle) * innerRadius;
                graphics.lineTo(xx, yy);
            }
            
            // Determine the ending angle of the arc so you can
            // rotate around the outer arc in the opposite direction.
            var endAngle:Number = startAngle + arcAngle;
            //
            // Start drawing all points on the outer arc.
            for(i = 0; i &lt;= steps; i++)
            {
                // To go the opposite direction, we subtract rather than add.
                angle = (endAngle - i * angleStep) * twoPI;
                xx = centerX + Math.cos(angle) * outerRadius;
                yy = centerY + Math.sin(angle) * outerRadius;
                graphics.lineTo(xx, yy);
            }
            
            // Close the shape by drawing a straight
            // line back to the inner arc.
            graphics.lineTo(startPointX, startPointY);
        }
    }
}</pre>
<p>&#8230;and a main application.mxml file:</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot; 
               xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot; 
               xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;
               preloader=&quot;sk.yoz.rtw.skins.white.components.Preloader&quot;&gt;
...</pre>
<p>Where to go from here:</p>
<ul>
<li><a href="http://blog.yoz.sk/2011/01/using-metadata-frame-for-preloader/">Using Metadata Frame for a Preloader</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2012/09/flex-arc-preloader-without-sparkdownloadprogressbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: FlexUnit &amp; JUnitReport &amp; haltonfailure</title>
		<link>http://blog.yoz.sk/2012/04/quick-tip-flexunit-and-junitreport-and-haltonfailure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quick-tip-flexunit-and-junitreport-and-haltonfailure</link>
		<comments>http://blog.yoz.sk/2012/04/quick-tip-flexunit-and-junitreport-and-haltonfailure/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 12:54:41 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[FlexUnit]]></category>
		<category><![CDATA[haltonfailure]]></category>
		<category><![CDATA[JUnitReport]]></category>
		<category><![CDATA[unit tests]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3200</guid>
		<description><![CDATA[In case you are using flexunit ant task with your flex builds and you are used to failed builds with haltonfailure=&#8221;true&#8221;, you may notice that junitreport task is not executed when unit tests fails. Without having test reports, it does not give you much info about what went wrong. Fortunately, there is a solution using [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/antunittest.png" alt="" title="antunittest" width="200" height="100" class="alignleft size-full wp-image-3164" /></p>
<p>In case you are using <a href="http://docs.flexunit.org/index.php?title=Ant_Task">flexunit ant task</a> with your flex builds and you are used to failed builds with haltonfailure=&#8221;true&#8221;, you may notice that junitreport task is not executed when unit tests fails. Without having test reports, it does not give you much info about what went wrong. Fortunately, there is a solution using attribute failureproperty and <a href="http://ant.apache.org/manual/Tasks/fail.html">fail ant task</a>. Here is a quick ant build config to generate junitreport report for failed unit tests followed by build fail.</p>
<p><span id="more-3200"></span></p>
<pre class="brush: xml; title: ; notranslate">&lt;flexunit toDir=&quot;${basedir}/${OUTPUT_DIRECTORY}&quot;
    workingDir=&quot;${basedir}/${OUTPUT_DIRECTORY}&quot;
    haltonfailure=&quot;false&quot; verbose=&quot;true&quot; localTrusted=&quot;true&quot;
    failureproperty=&quot;flexunit.failure&quot;
    swf=&quot;${basedir}/${OUTPUT_DIRECTORY}/TestRunner.swf&quot;/&gt;

&lt;mkdir dir=&quot;target/surefire-reports&quot; /&gt;

&lt;junitreport todir=&quot;target/surefire-reports&quot;&gt;
    &lt;fileset dir=&quot;${basedir}/${OUTPUT_DIRECTORY}&quot;&gt;
        &lt;include name=&quot;TEST-*.xml&quot;/&gt;
    &lt;/fileset&gt;
    &lt;report format=&quot;frames&quot; todir=&quot;target/surefire-reports/html&quot;/&gt;
&lt;/junitreport&gt;

&lt;fail if=&quot;flexunit.failure&quot; message=&quot;Unit test(s) failed. See reports!&quot;/&gt;</pre>
<p>Notice: <em>haltonfailure</em>, <em>failureproperty</em>, <em>fail</em></p>
<p>Where to go from here:</p>
<ul>
<li><a href="http://blog.yoz.sk/2012/01/quicktip-flexunit-and-ant/">Quick Tip: FlexUnit &#038; ANT</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2012/04/quick-tip-flexunit-and-junitreport-and-haltonfailure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YCanvas Remote Controlled By Remotair</title>
		<link>http://blog.yoz.sk/2012/01/ycanvas-remote-controlled-by-remotair/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ycanvas-remote-controlled-by-remotair</link>
		<comments>http://blog.yoz.sk/2012/01/ycanvas-remote-controlled-by-remotair/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 09:09:41 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Multitouch]]></category>
		<category><![CDATA[Remotair]]></category>
		<category><![CDATA[remote controll]]></category>
		<category><![CDATA[RTMFP]]></category>
		<category><![CDATA[YCanvas]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3188</guid>
		<description><![CDATA[At the same time I released YCanvas, I have spotted an interesting starling experiment. I realized I can do this for YCanvas easily with Remotair. Remotair is a concept of transmitting device inputs (gestures, accelerometer, camera etc.) into receiving flash or AIR application. Consists of one transmitting app installed on a mobile device or a [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/ycanvas-remotair.jpg" alt="" title="ycanvas-remotair" width="200" height="100" class="alignleft size-full wp-image-3189" /></p>
<p>At the same time I released <a href="http://blog.yoz.sk/2012/01/introduction-to-ycanvas/">YCanvas</a>, I have spotted an interesting <a href="http://vimeo.com/35173287">starling experiment</a>. I realized I can do this for YCanvas easily with <a href="http://remotair.yoz.sk/">Remotair</a>. Remotair is a concept of transmitting device inputs (gestures, accelerometer, camera etc.) into receiving flash or AIR application. Consists of one transmitting app installed on a mobile device or a tablet and one receiving app running on a PC. In order to pair transmitting and receiving application, RTMFP protocol is used. Implementing remotair reciever into any flash application takes only a few minutes, I spent much more time on touch + multitouch implementation with transitions. At the end of the day, I was able to remote controll YCanvas application with BlackBerry Playbook. </p>
<p><span id="more-3188"></span></p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/V0NUIq547dY" frameborder="0" allowfullscreen></iframe></p>
<p>If you want to try it yourself, YCanvas application is available on <a href="http://ycanvas.yoz.sk/remotair/">ycanvas.yoz.sk/remotair</a>, and you can download free Remotair app for <a href="http://appworld.blackberry.com/webstore/content/23068">Playbook</a> or <a href="https://market.android.com/details?id=air.sk.yoz.remotair">Android</a> devices from markets. Source is available on <a href="http://ycanvas.yoz.sk/">ycanvas.yoz.sk</a>.</p>
<ol>
<li>download Remotair application to your device</li>
<li>open and click connect, you should recieve a channel id (e.g. 1008)</li>
<li>open <a href="http://ycanvas.yoz.sk/remotair/">ycanvas.yoz.sk/remotair</a> on your pc</li>
<li>notice white TextInput on top-right position, insert channel id (e.g. 1008) and press enter.</li>
<li>device get paired with your pc and after that you should se &#8220;Touch&#8221; option in Remotair application, click it to open Touch view</li>
<li>use one-finer or two-finger gestures to remotely move, rotate and scale application on a pc</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2012/01/ycanvas-remote-controlled-by-remotair/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Introduction to YCanvas</title>
		<link>http://blog.yoz.sk/2012/01/introduction-to-ycanvas/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=introduction-to-ycanvas</link>
		<comments>http://blog.yoz.sk/2012/01/introduction-to-ycanvas/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 09:17:50 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[onBoard]]></category>
		<category><![CDATA[Stage3D]]></category>
		<category><![CDATA[Wall Of Fame]]></category>
		<category><![CDATA[WebCanvas]]></category>
		<category><![CDATA[YCanvas]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=3167</guid>
		<description><![CDATA[Hello YCanvas, who are you? I am an open source ActionScript 3 library that provides stage3D (GPU) engine for perfectly overlapping grid based zooming projects like world maps or onBoard. What? Ok, I am the engine that statnds behind onBoard, and I can handle much more. I can implement Wall Of Fame, WebCanvas, MapQuest, ArcGIS, [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/ycanvas.jpg" alt="" title="ycanvas" width="200" height="100" class="alignleft size-full wp-image-3168" /></p>
<p>Hello <a href="http://ycanvas.yoz.sk">YCanvas</a>, who are you? I am an open source ActionScript 3 library that provides stage3D (GPU) engine for perfectly overlapping grid based zooming projects like world maps or <a href="http://onboard.yoz.sk">onBoard</a>. What? Ok, I am the engine that statnds behind onBoard, and I can handle much <a href="http://ycanvas.yoz.sk/explorer">more</a>. I can implement <a href="http://wall-of-fame.com/">Wall Of Fame</a>, <a href="http://webcanvas.com/">WebCanvas</a>, <a href="http://www.mapquest.com/">MapQuest</a>, <a href="http://www.esri.com/software/arcgis/index.html">ArcGIS</a>, <a href="http://www.openstreetmap.org/">Open Street Map</a> or do some experiments like <a href="http://www.flickr.com/">Flickr gallery</a>, all this in one flash, few lines (10-20) of specific code per mode, all running at 60 FPS. Anyhing else would you like to see implemented? Just let me know&#8230; Do you want to know more and see it in action?</p>
<p><span id="more-3167"></span></p>
<p>Enough talking, now impress me!</p>
<p><iframe src="http://ycanvas.yoz.sk/explorer/" width="100%" height="500" style="border:none;"></iframe></p>
<p>This is YCanvas explorer demo (<a href="http://ycanvas.yoz.sk/explorer/" target="_blank">run fullscreen</a>), you can find sources on <a href="http://ycanvas.yoz.sk">repository</a>.</p>
<p>There is also <a href="http://ycanvas.yoz.sk/demo/" target="_blank">simpliest possible implementation</a> of YCanvas available with sources as well.</p>
<h2>FAQ:</h2>
<p><strong>Q: Can you run on mobile/AIR?</strong><br />
A: Comes hand in hand with Stage3D available in AIR for mobile.</p>
<p><strong>Q: Can you run google maps?</strong><br />
A: Technicaly yes, on AIR there is no problem at all. In case of Flash Player, however, engine uploads BitmapData to graphic cards, in order to upload it you need the access that would be granted via crossdomain.xml, and unfortunately google maps domains do not serve one.</p>
<p><strong>Q: What are the requirements?</strong><br />
A: wmode=direct, flash player 11.1</p>
<p><strong>Q: Do you have a CPU fallback in case there is no GPU available</strong><br />
A: Not yet.</p>
<p><strong>Q: Do you have a support for moving, rotating, zooming?</strong><br />
A: The YCanvas api lets you set all of these manualy, or you can use available util classes in case you want to rotate around specific point or zoom to specific place. Checkout demo and explorer sources in repository.</p>
<p><strong>Q: Do you have multi touch support, gesture suppport?</strong><br />
A: Yes, have a look at ApplicationRemotair in sources. You can use two finger gestures to move, rotate, scale.</p>
<p><strong>Q: Do you have implementation for drawing?</strong><br />
A: Yes! Any display object on stage can be applied/drawn as simple as by calling one function. Read more in asdoc.</p>
<p><strong>Q: Can I convert points to latitude longitude?</strong><br />
A: Yes! Have a look at <a href="http://classes.yoz.sk/sk/yoz/rtw/utils/GeoUtils.as">GeoUtils.as</a> and <a href="http://classes.yoz.sk/sk/yoz/rtw/valueObjects/Boundary.as">Boundary.as</a>.</p>
<p><strong>Q: I like it and I want to support. How?</strong><br />
A: Cool, feel free to <a href="http://ycanvas.yoz.sk/donate.html">donate via PayPal here</a>. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2012/01/introduction-to-ycanvas/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
	</channel>
</rss>
