<?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>Jappit.com &#187; kunerilite</title>
	<atom:link href="http://www.jappit.com/blog/tag/kunerilite/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jappit.com/blog</link>
	<description>Mobile blog by Alessandro La Rosa</description>
	<lastBuildDate>Wed, 23 Nov 2011 10:38:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Create your first Flash Lite ringtone with KuneriLite</title>
		<link>http://www.jappit.com/blog/2008/10/08/create-your-first-flash-lite-ringtone-with-kunerilite/</link>
		<comments>http://www.jappit.com/blog/2008/10/08/create-your-first-flash-lite-ringtone-with-kunerilite/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 14:02:27 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[flash lite]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[kunerilite]]></category>
		<category><![CDATA[ringtones]]></category>
		<category><![CDATA[s60]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[symbian]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=110</guid>
		<description><![CDATA[For those of you who missed it (really??) latest KuneriLite versions have added support for Flash Lite ringtones, one of the coolest FlashLite features around!! Today, we&#8217;ll see how it is simple to create a FlashLite ringtone with caller-id support and an application that allows users to easily set and unset it. Step 1: The [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who missed it (really??) latest <a title="KuneriLite" href="http://www.kunerilite.net" target="_blank">KuneriLite</a> versions have added support for <a title="KuneriLite Ringtone plugin" href="http://wiki.kunerilite.net/index.php?title=Ringtone_plugin" target="_blank">Flash Lite ringtones</a>, <strong>one of the coolest FlashLite features around</strong>!!</p>
<p>Today, we&#8217;ll see how it is simple to <strong>create a FlashLite ringtone with caller-id support</strong> and an application that allows users to easily set and unset it.</p>
<h3>Step 1: The FlashLite ringtone</h3>
<p>To start, we&#8217;ll build a really simple <strong>FlashLite ringtone</strong>.</p>
<p>Let&#8217;s start building a <strong>simple interface, with these elements</strong>:</p>
<p><img class="alignnone" title="KuneriLite ringtone setter screenshot" src="http://www.jappit.com/images/blog/uploads/kunerilite_ringtone.png" alt="" /></p>
<p>Now it&#8217;s time to add some <strong>ActionScript</strong> to our interface. So, let&#8217;s open <strong>frame 1 of our Actions layer</strong>.</p>
<blockquote><p><strong>Important note:</strong> when using KuneriLite from a ringtone SWF, you MUST use <strong>port 2001</strong>.</p></blockquote>
<p>First, we&#8217;ll define a method to <strong>retrieve caller infos</strong>, and display it, depending on the returned data:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">var loader<span style="color: #339933;">:</span>LoadVars <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> LoadVars<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
getCallerName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
function getCallerName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Getting caller's info... &quot;</span><span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">onLoad</span> <span style="color: #339933;">=</span> callerNameHandler<span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://127.0.0.1:2001/Basic/ring?klCommand=callerid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
function callerNameHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">+=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">klError</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		callerName.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Command error: &quot;</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">klError</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">klName</span> <span style="color: #339933;">!=</span> undefined<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		callerName.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">klName</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #009900;">&#123;</span>
		callerName.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">klNumber</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And then, let&#8217;s add the call <strong>answer/reject functionality</strong> to our ringtone. Two other KuneriLite calls will do the job (note that we&#8217;ll reuse the LoadVars instance defined above):</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">answer.<span style="color: #006633;">onPress</span> <span style="color: #339933;">=</span> function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Answering call... &quot;</span><span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">onLoad</span> <span style="color: #339933;">=</span> callCommandHandler<span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://127.0.0.1:2001/Basic/ring?klCommand=answercall&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
reject.<span style="color: #006633;">onPress</span> <span style="color: #339933;">=</span> function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Rejecting call... &quot;</span><span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">onLoad</span> <span style="color: #339933;">=</span> callCommandHandler<span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://127.0.0.1:2001/Basic/ring?klCommand=hangupcall&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
function callCommandHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">+=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<blockquote><p><strong>Important note</strong>: since <strong>KuneriLite ringtone plugin already handles device answer and reject keys</strong> (the green and red one) you could avoid implementing your custom buttons in ringtone SWF (<strong>thanks Jukka</strong> for the reminder!)</p></blockquote>
<h3>Step 2: Setting and unsetting the ringtone</h3>
<p>Now, it&#8217;s time to <strong>build the &#8220;main&#8221; SWF application</strong>, that is the one that the user would launch from phone menu to manage its FlashLite ringtones.</p>
<p>As usual, let&#8217;s create a basic interface, with this layout:</p>
<p><img class="alignnone" title="KuneriLite ringtone setter screenshot" src="http://www.jappit.com/images/blog/uploads/kunerilite_ringtone_setter.png" alt="" width="450" height="322" /></p>
<p>Now, let&#8217;s <strong>add the necessary ActionScript code</strong> to our Buttons.<br />
This is for the <strong>enable button</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">enableButton.<span style="color: #006633;">onPress</span> <span style="color: #339933;">=</span> function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Enabling ringtone..&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	var loader<span style="color: #339933;">:</span>LoadVars <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> LoadVars<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">onLoad</span> <span style="color: #339933;">=</span> handleResponse<span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://127.0.0.1:1001/Basic/ring?klCommand=enableringswf&amp;amp;klPath=ringtone.swf&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And similarly, this is for the <strong>disable button</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">disableButton.<span style="color: #006633;">onPress</span> <span style="color: #339933;">=</span> function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Disabling ringtone..&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	var loader<span style="color: #339933;">:</span>LoadVars <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> LoadVars<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">onLoad</span> <span style="color: #339933;">=</span> handleResponse<span style="color: #339933;">;</span>
&nbsp;
	loader.<span style="color: #006633;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://127.0.0.1:1001/Basic/ring?klCommand=disableringswf&amp;amp;klPath=ringtone.swf&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And here&#8217;s the handler, used by both commands calls, to print out the KuneriLite response error code:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">function handleResponse<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	commandOutput.<span style="color: #006633;">text</span> <span style="color: #339933;">+=</span> <span style="color: #0000ff;">&quot; Error code: &quot;</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">klError</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>Step 3: building and testing</h3>
<p>Building a <strong>KuneriLite </strong>app is <a title="KuneriLite Wizard Beginner's Guide" href="http://wiki.kunerilite.net/index.php?title=KuneriLite_Wizard_Beginner%27s_Guide" target="_blank">easy as always</a>, but you need to follow these <strong>4 specific steps</strong> to make the ringtone correctly work:</p>
<ol>
<li><strong>Select Ringtone plugin</strong><br />
<img class="alignnone" title="KuneriLite ringtone wizard step 1 screenshot" src="http://www.jappit.com/images/blog/uploads/ringtone_wizard_step1.jpg" alt="" width="351" height="252" /></li>
<li>Place your <strong>ringtone SWF in a separate folder</strong>, containing only that SWF, and then select it on Wizard Step 2<br />
<img class="alignnone" title="KuneriLite ringtone wizard step 2 screenshot" src="http://www.jappit.com/images/blog/uploads/ringtone_wizard_step2.jpg" alt="" width="412" height="271" /></li>
<li>Select the <strong>ringtone setter as main SWF</strong><br />
<img class="alignnone" title="Ringtone KuneriLite wizard step 4 screenshot" src="http://www.jappit.com/images/blog/uploads/ringtone_wizard_step4.jpg" alt="" width="394" height="130" /></li>
<li>Since <strong>Ringtone plugin needs signing</strong>, on Step 3 fill in the certificate infos<br />
<img class="alignnone" title="KuneriLite ringtone wizard step 3 screenshot" src="http://www.jappit.com/images/blog/uploads/ringtone_wizard_step3.jpg" alt="" width="360" height="228" /></li>
</ol>
<p>Once done, just compile and transfer your SIS on your phone, install and launch it:</p>
<ul>
<li>on main app screen, <strong>click the enable button</strong></li>
<li>check the command output, to see if the command executed <strong>successfully</strong>: you should see this message
<pre>Enabling ringtone... Error code: 0</pre>
</li>
<li>if yes, just close the app and <strong>call your own phone</strong>, and your FlashLite ringtone will magically appear!</li>
<li>within the ringtone SWF you will see the <strong>caller&#8217;s name</strong> (if available on your phonebook), otherwise its phone number</li>
<li>to <strong>answer or reject the incoming call</strong>, simply use the buttons we previously placed on stage</li>
</ul>
<p>That&#8217;s it!</p>
<h3>Conclusions</h3>
<p>Now, add this with the other <a title="KuneriLite Plugins" href="http://wiki.kunerilite.net/index.php?title=KuneriLite_Plug-ins" target="_blank">KuneriLite features</a>, and you could end up having:</p>
<ul>
<li><strong>browsable ringtones catalogs</strong>, directly downloadable from your FlashLite app</li>
<li><strong>ringones for specific contacts</strong> (a phonebook plugin would be great!)</li>
<li><strong>location-based ringones</strong>!</li>
</ul>
<p>Isn&#8217;t this enough?</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/10/08/create-your-first-flash-lite-ringtone-with-kunerilite/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mobile Mtv Blog Uploader: yet another FlashLite and J2ME apps!</title>
		<link>http://www.jappit.com/blog/2008/07/18/mobile-mtv-blog-uploader-yet-another-flashlite-and-j2me-apps/</link>
		<comments>http://www.jappit.com/blog/2008/07/18/mobile-mtv-blog-uploader-yet-another-flashlite-and-j2me-apps/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 14:44:14 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[flash lite]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[blog uploader]]></category>
		<category><![CDATA[forumnokia]]></category>
		<category><![CDATA[java me]]></category>
		<category><![CDATA[kunerilite]]></category>
		<category><![CDATA[mobile blog]]></category>
		<category><![CDATA[mtv]]></category>
		<category><![CDATA[mtv community]]></category>
		<category><![CDATA[mtvmobile]]></category>
		<category><![CDATA[portfolio]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=58</guid>
		<description><![CDATA[As told some days ago, MtvMobile launched 2 phones with its initial offer as virtual mobile operator. And, for these 2 phones (a Nokia 5320 and a SE W760), 2 cool applications were lauched. I&#8217;ve already talked about Mtv OnDemand, a FlashLite and Java ME streaming video player that allows users to view selected MTV [...]]]></description>
			<content:encoded><![CDATA[<p>As told <a title="MtvOnDemand" href="http://www.jappit.com/blog/2008/07/15/mtv-on-demand-new-flashlite-and-java-me-apps-released/">some days ago</a>, <a title="MtvMobile website" href="http://www.mtvmobile.it/" target="_blank">MtvMobile </a>launched 2 phones with its initial offer as <strong>virtual mobile operator</strong>. And, for these 2 phones (a <a title="Nokia 5320 specifications" href="http://www.forum.nokia.com/devices/5320_XpressMusic" target="_blank">Nokia 5320</a> and a <a title="Sony Ericsson W760 specifications" href="http://www.sonyericsson.com/cws/products/mobilephones/overview/w760i" target="_blank">SE W760</a>), <strong>2 cool applications</strong> were lauched. I&#8217;ve already talked about <a title="MtvOnDemand" href="http://www.mtvmobile.it/enjoy/ondemand.action" target="_blank">Mtv OnDemand</a>, a FlashLite and Java ME <strong>streaming video player</strong> that allows users to view selected MTV videos, and download related content (like ringtones and wallpapers).</p>
<p>Now it&#8217;s time to view the other one: it&#8217;s called <a title="Mtv Blog Uploader" href="http://www.mtvmobile.it/enjoy/uploader.action" target="_blank">Mtv.it Blog</a>, and it&#8217;s a simple and effective mobile blog uploader.</p>
<p><img src="http://www.jappit.com/images/blog/uploads/mtvitblog_screenshots.jpg" alt="Mtv.it blog Uploader screenshots" width="460" height="214" /></p>
<p>Using this app, users are able to upload contents (photos, videos, audio or simple text) from their mobile phone directly on their <a title="Mtv community" href="http://www.mtv.it/mymtv/" target="_blank">Mtv blog</a>. As for <strong>Mtv OnDemand</strong>, there are both a  <a title="Java ME website" href="http://java.sun.com/javame/index.jsp" target="_blank">Java ME</a> and a <a title="FlashLite website" href="http://www.adobe.com/products/flashlite/" target="_blank">Flash Lite</a> version of this app, quite identical in both their interface and functionalities.</p>
<p>As for the other one, I&#8217;ll post <strong>complete videos</strong> of this app as soon as I have it working again <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/07/18/mobile-mtv-blog-uploader-yet-another-flashlite-and-j2me-apps/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>FliKun: KuneriLite based FlashLite photo uploader for Flickr</title>
		<link>http://www.jappit.com/blog/2008/06/25/flikun-kunerilite-based-flashlite-photo-uploader-for-flickr/</link>
		<comments>http://www.jappit.com/blog/2008/06/25/flikun-kunerilite-based-flashlite-photo-uploader-for-flickr/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 12:02:35 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[flash lite]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[geotagging]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[image thumbs]]></category>
		<category><![CDATA[kunerilite]]></category>
		<category><![CDATA[rest api]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=54</guid>
		<description><![CDATA[Today, we&#8217;ll see how it&#8217;s possible to build a Flickr uploader in FlashLite using KuneriLite, geotagging our photos with the current GPS location. You can download the current FliKun version (for FlashLite 3.0) here: FliKun_3rd_edition_unsigned.sis (please read the notes at the end of this article). So, let&#8217;s start from the beginning. Flickr API To upload [...]]]></description>
			<content:encoded><![CDATA[<p>Today, we&#8217;ll see how it&#8217;s possible to build a <strong><a title="Flickr uploader" href="http://www.flickr.com/" target="_blank">Flickr</a> uploader in <a title="FlashLite website" href="http://www.adobe.com/products/flashlite/" target="_blank">FlashLite</a> using <a title="KuneriLite website" href="http://www.kunerilite.net/" target="_blank">KuneriLite</a></strong>, geotagging our photos with the current <strong>GPS location</strong>.</p>
<p>You can download the current <strong>FliKun</strong> version (for FlashLite 3.0) here: <a title="FliKun Flash Lite Flickr uploader" href="http://www.jappit.com/uploads/kunerilite/FliKun_3rd_edition_unsigned.sis">FliKun_3rd_edition_unsigned.sis</a> (<em>please read the notes at the end of this article</em>).</p>
<p><img src="http://www.jappit.com/images/blog/uploads/flikun.jpg" alt="Flikun Screenshots" width="480" height="213" /></p>
<p>So, let&#8217;s start from the beginning.</p>
<h3>Flickr API</h3>
<p>To upload photos to Flickr we&#8217;ll need to use <a title="Flickr API" href="http://www.flickr.com/services/api/" target="_blank">Flickr API</a>: this way we&#8217;ll be able to <strong>authenticate the user</strong> and <strong>upload/geotag photos</strong> using its REST services, all from within our application.</p>
<p>First thing we should do is to setup an <strong>API key</strong> for our service, going on the <a title="Flickr API key request page" href="http://www.flickr.com/services/api/keys/apply/" target="_blank">request page</a>. Here you have to fill out the <strong>application details</strong>, with special care to the authentication method we want to use: suitable choices for our needs would be both <a title="Flickr Desktop authentication" href="http://www.flickr.com/services/api/auth.howto.desktop.html" target="_blank"><strong>desktop</strong></a> and <a title="Flickr mobile application authentication" href="http://www.flickr.com/services/api/auth.howto.mobile.html" target="_blank"><strong>mobile application</strong></a> authentications:</p>
<ul>
<li>With the first option the user will be redirected to a Flickr page, from within our application, where he should authenticate and <strong>grant necessary permissions</strong> to our application.</li>
<li>With the second option we can let the user generate a <strong>mini-token</strong> from a dedicated page, using his desktop browser, and then tell him to insert this mini-token within in our application.</li>
</ul>
<p>In both cases, we will get a <strong>token</strong> that will be used for all future uses of our application, so there would be no more need to authenticate the user after the first time.</p>
<h3>KuneriLite Plugins</h3>
<p>In our application, we will need to access these <strong>functionalities</strong>:</p>
<ul>
<li><strong>Retrieve photos</strong> stored in phone&#8217;s gallery</li>
<li><strong>Make thumbs</strong> to show them in our application</li>
<li><strong>Start the GPS</strong> and retrieve user&#8217;s current location</li>
<li><strong>Upload</strong> stored photo on Flickr server</li>
</ul>
<p>So, we&#8217;ll need to use the following <strong>KuneriLite plugins</strong>:</p>
<ul>
<li><a title="KuneriLite GPS plugin" href="http://wiki.kunerilite.net/index.php?title=GPS_plugin" target="_blank">GPS</a>: we&#8217;ll use the <strong>start</strong> command to start GPS, and the <strong>read</strong> command to read current location</li>
<li><a title="KuneriLite File plugin" href="http://wiki.kunerilite.net/index.php?title=File_plugin" target="_blank">File</a>: with <strong>dir</strong> command we&#8217;ll be able to list files in phone&#8217;s gallery folders. We&#8217;ll use this also to store textual infos, like the user token</li>
<li><a title="KuneriLite Upload/Download plugin" href="http://wiki.kunerilite.net/index.php?title=Upload/Download_plugin" target="_blank">Upload/Download</a>: with this plugin we&#8217;ll <strong>upload</strong> the photos to Flickr website, using its API, and create the thumbs (with the <strong>resize</strong> command) to show them within our application</li>
</ul>
<h3>Get a token</h3>
<p>We&#8217;ll use the <strong>desktop authentication method</strong>, so these are the steps required to authenticate the user, and to get his token:</p>
<ul>
<li>Get a <strong>frob</strong>, with the Flickr <strong>flickr.auth.getFrob</strong> method</li>
<li>Generate the desktop <strong>authentication URL</strong> with the given frob</li>
<li>Send the user to the generated URL, using the <strong>phone browser</strong>, where he should authenticate and grand permissions to our application</li>
<li>When the user is back to our application, we will finally get his authentication <strong>token</strong> with the <strong>flickr.auth.getToken</strong> Flickr method</li>
</ul>
<p>All these Flickr API calls need to be signed with an api_sig parameter, that is explained here: <a title="Flickr authentication API page" href="http://www.flickr.com/services/api/auth.spec.html" target="_blank">Flickr Authentication API page</a> (in the <strong>Signing</strong> paragraph). To generate it in our FlashLite application, we&#8217;ll use the following function:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">function getApiSignature<span style="color: #009900;">&#40;</span>args<span style="color: #339933;">:</span><span style="color: #003399;">Object</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	var authSig<span style="color: #339933;">:</span><span style="color: #003399;">Array</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>var key<span style="color: #339933;">:</span><span style="color: #003399;">String</span> in args<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		authSig.<span style="color: #006633;">push</span><span style="color: #009900;">&#40;</span>key <span style="color: #339933;">+</span> args<span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	authSig <span style="color: #339933;">=</span> authSig.<span style="color: #006633;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	var apiSig<span style="color: #339933;">:</span><span style="color: #003399;">String</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>._md5.<span style="color: #006633;">hash</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;</span>API_SECRET<span style="color: #339933;">&gt;</span> <span style="color: #339933;">+</span> authSig.<span style="color: #006633;">join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">return</span> apiSig<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>where &lt;API_SECRET&gt; is the <strong>API Secret associated to your API Key</strong> (you can see both of them on <a title="Flickr API keys" href="http://www.flickr.com/services/api/keys/" target="_blank">Flickr API Keys page</a>).</p>
<p>If all has gone well, we will finally get the user token, that we must store somewhere (for example using SharedObject, or within a local file using KuneriLite file plugin).</p>
<h3>Show phone gallery photos</h3>
<p>Since we&#8217;ll use <strong>S60 3rd edition phones</strong>, we&#8217;ll search for photos in these folders: &#8220;<em>C:\Data\Images\&#8221;</em> and <em>&#8220;E:\Images\&#8221;</em>. Since on these phones photos will be stored in many <strong>subfolders</strong>, we&#8217;ll search within them, using &#8220;/s&#8221; argument within KuneriLite <strong>dir</strong> call. Also, we should <strong>avoid listing photo thumbs</strong>, that are stored<br />
in subfolders named &#8220;_PAlbTN&#8221;, so it&#8217;ll be easy to spot out and avoid to get them.</p>
<p>Once we have the photo paths, we can use the KuneriLite resize <strong>command</strong> to resize them to our <strong>preferred size</strong>, and use those thumbs within our application. In doing this, we should care for the following points:</p>
<ul>
<li>It&#8217;s <strong>not possible to load more than 5 resources at once</strong>, so we should generate and load thumbs in a progressive manner, otherwise we will have lost calls (without any feedback or exception) within our application</li>
<li>While loading a thumb in a MovieClip, we should take care <strong>not to remove the Clip while it&#8217;s loading</strong> (for example, because the user has navigated to another screen). Doing this we&#8217;ll avoid the issue described <a title="FlashLite moviecliploader issue" href="http://www.jappit.com/blog/2008/04/23/flashlite-and-moviecliploader-loadclip-issue/" target="_blank">here</a>.</li>
</ul>
<h3>Enter photo details and upload it!</h3>
<p>Once the user has selected a photo, we should let him <strong>enter photo data (title, description and tags)</strong>, and then let him choose if he wants to <strong>tag with his location the photo itself</strong>.</p>
<p>In this case, we can use the approach described in this other article to <strong>retrieve the current GPS location</strong>: <a title="displaying gps position in flashlite using google static maps and kunerilite" href="http://www.jappit.com/blog/2008/06/12/displaying-gps-position-in-flashlite-using-google-static-maps-and-kunerilite/" target="_blank">Displaying gps position in flashlite using google static maps and kunerilite</a>.</p>
<p>Once we have the GPS location coordinates, we can finally upload the photo to Flickr website with the <a title="Flickr Upload API" href="http://www.flickr.com/services/api/upload.api.html" target="_blank">upload API</a>. Since the upload API itself requires, apart from the file itself, to send the <strong>other params within the POST body</strong>, we should use some sort of <strong>server proxy</strong>, since KuneriLite <strong>upload</strong> command does not allow to post them this way. What we could do is to send the textual parameters within the upload URL, and then let our proxy POST them to Flickr server.</p>
<h3>Get FliKun!</h3>
<p>This <strong>first release </strong>of <strong>FliKun</strong> is very (very!) alpha, so try it at your own risk <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  jokes apart, there are still many points open (like the <strong>horrible graphics</strong>!), so expect new versions as soon as I&#8217;ve got the time to work more on it!</p>
<p>Download <a title="Flikun Alpha version" href="http://www.jappit.com/uploads/kunerilite/FliKun_3rd_edition_unsigned.sis" target="_blank">FliKun_3rd_edition_unsigned.sis</a> (for FlashLite 3.0).</p>
<p>Currently known issues/bugs are:</p>
<ul>
<li><span style="text-decoration: line-through;">Sometimes upload fails, especially when using some special characters</span></li>
<li>There is no upload progress bar (but will be added very soon)</li>
<li>File upload fails (with error code -4) when photo size is bigger than approx 450 Kb (I&#8217;m <strong>currently working to solve this</strong>)</li>
</ul>
<p>For any other bugs you may encounter, please leave comment on this post! Thanks <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Finally note that, to use the <strong>GPS</strong> feature, you&#8217;ll need to <strong>sign the SIS file with a valid certificate</strong>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/25/flikun-kunerilite-based-flashlite-photo-uploader-for-flickr/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Displaying GPS position in FlashLite using Google Static Maps and KuneriLite</title>
		<link>http://www.jappit.com/blog/2008/06/12/displaying-gps-position-in-flashlite-using-google-static-maps-and-kunerilite/</link>
		<comments>http://www.jappit.com/blog/2008/06/12/displaying-gps-position-in-flashlite-using-google-static-maps-and-kunerilite/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 12:46:14 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[flash lite]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[forumnokia]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[google static maps]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[kunerilite]]></category>
		<category><![CDATA[localization]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=49</guid>
		<description><![CDATA[Today&#8217;s tutorial is about using Google Maps static images, and GPS data, to display maps in a FlashLite application using KuneriLite. Prerequisites Get your own Google Maps API key To use Google Maps services, you should have a Google Maps API key. If you do not have one, you can go here: http://code.google.com/apis/maps/signup.html and signup [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s tutorial is about using <a title="Google Static Maps documentation" href="http://code.google.com/apis/maps/documentation/staticmaps/" target="_blank">Google Maps static images</a>, and GPS data, to display maps in a <a title="FlashLite website" href="http://www.adobe.com/products/flashlite/" target="_blank">FlashLite</a> application using <a title="KuneriLite website" href="http://www.kunerilite.net" target="_blank">KuneriLite</a>.</p>
<p><img src="http://www.jappit.com/images/blog/uploads/kuneri_maps_screenshot.jpg" alt="FlashLite KuneriLite Google Maps application screenshot" width="333" height="291" /></p>
<h3>Prerequisites</h3>
<h4>Get your own Google Maps API key</h4>
<p>To use Google Maps services, you should have a <strong>Google Maps API key</strong>. If you do not have one, you can go here:</p>
<p><a title="Google Maps API key signup page" href="http://code.google.com/apis/maps/signup.html" target="_blank">http://code.google.com/apis/maps/signup.html</a></p>
<p>and signup for your API key.</p>
<h4>Download and install KuneriLite</h4>
<p><strong><a title="KuneriLite website" href="http://www.kunerilite.net" target="_blank">KuneriLite</a> </strong>is a tookit that <strong>extends FlashLite capabilites</strong> allowing applications to access <strong>native Symbian functionalities</strong>, like file writing, or reading <strong>GPS data</strong>.</p>
<p>To proceed in this tutorial, you must download and install KuneriLite: <a title="KuneriLite download page" href="http://www.kunerilite.net/content/view/33/47/" target="_blank">KuneriLite download page</a>.</p>
<h3>Create FlashLite application</h3>
<h4>Create your FlashLite movie</h4>
<p>In this example, we&#8217;ll use FlashLite 2.1, but porting it to other (older or newer) FlashLite versions will be quite straightforward. So, after you&#8217;ve created an empty FlashLite movie, follow this simple steps:</p>
<ul>
<li><strong> Create a Button</strong> by going to <em>Insert -&gt; New Symbol&#8230;</em></li>
<li> enter <strong>GpsButton as name</strong></li>
<li> check the <strong>Export for ActionScript</strong> and <strong>Export in first frame checkboxes</strong></li>
</ul>
<p><img src="http://www.jappit.com/images/blog/uploads/gpsButtonProperties.jpg" alt="GpsButton properties" width="429" height="330" /></p>
<ul>
<li> Now, design your Button as you prefer, for example placing a big <strong>&#8220;Find me!&#8221; label</strong> on it</li>
<li> After you&#8217;ve finished designing your Button, place it on movie root, in the lower part of the stage, as in the attached screenshot, and give it <strong>startButton as Instance Name</strong></li>
</ul>
<p><img src="http://www.jappit.com/images/blog/uploads/buttonOnStage.jpg" alt="Place GpsButton on stage" width="295" height="350" /></p>
<h4>Enter ActionScript code</h4>
<p>On movie root, <strong>create a new layer called Actions</strong>, and open its ActionScript editor. We&#8217;ll start defining some properties:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// Enter your api key here</span>
<span style="color: #000000; font-weight: bold;">var</span> apiKey = <span style="color: #ff0000;">'API_KEY'</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//If you're using non-commercial version of KuneriLite, you'll not need to change this</span>
<span style="color: #000000; font-weight: bold;">var</span> kuneriPath = <span style="color: #ff0000;">'http://127.0.0.1:1001/Basic/'</span>;</pre></div></div>

<p>Now, we&#8217;ll define some useful functions that we&#8217;ll use in our code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//We'll call this function when some KuneriLite related errors occur</span>
<span style="color: #000000; font-weight: bold;">function</span> kuneriError<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;KuneriLite error: &quot;</span> + <span style="color: #0066CC;">error</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//This function will do all calls to KuneriLite servers</span>
<span style="color: #808080; font-style: italic;">//and call the given handler passing response values as argument</span>
<span style="color: #000000; font-weight: bold;">function</span> kuneriLoad<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">url</span>, handler<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> loader:<span style="color: #0066CC;">LoadVars</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	loader.<span style="color: #0066CC;">onLoad</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		handler<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;LOADING: &quot;</span> + <span style="color: #0066CC;">url</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">url</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Now, let&#8217;s code the Button-related logic. When the user presses the <strong>startButton </strong>we want to:</p>
<ul>
<li> start the GPS</li>
<li> retrieve the current GPS position</li>
<li> display a map centered in the retrieved GPS position</li>
</ul>
<p>To get full infos about about KuneriLite GPS plugin, you can check the related Wiki page: <a title="KuneriLite GPS plugin Wiki page" href="http://wiki.kunerilite.net/index.php?title=GPS_plugin" target="_blank">http://wiki.kunerilite.net/index.php?title=GPS_plugin</a></p>
<p>We begin starting the GPS on gpsButton press, using the <strong>start klCommand</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">startButton.<span style="color: #0066CC;">onPress</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	kuneriLoad<span style="color: #66cc66;">&#40;</span>kuneriPath + <span style="color: #ff0000;">'GPS?klCommand=start'</span>, gpsStarted<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> gpsStarted<span style="color: #66cc66;">&#40;</span>res:<span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>res.<span style="color: #006600;">klError</span> == <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">||</span> res.<span style="color: #006600;">klError</span> == -<span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;GPS started&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		kuneriLoad<span style="color: #66cc66;">&#40;</span>kuneriPath + <span style="color: #ff0000;">'GPS?klCommand=read'</span>, gpsDataRead<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #66cc66;">&#123;</span>
		kuneriError<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Error starting GPS!&quot;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The <strong>gpsStarted() </strong>handler will:</p>
<ul>
<li> check if there is no error (<strong>klError = 0</strong>) or if GPS is already started (<strong>klError = -11</strong>). For full errors list associated with GPS plugin, check KuneriLite Wiki page:<a title="KuneriLite GPS plugin Wiki page" href="http://wiki.kunerilite.net/index.php?title=GPS_plugin" target="_blank"> <a href="http://wiki.kunerilite.net/index.php?title=GPS_plugin" rel="nofollow">http://wiki.kunerilite.net/index.php?title=GPS_plugin</a></a></li>
<li> if there&#8217;s an error starting the GPS, call our kuneriError() function defined above</li>
<li> if GPS is correctly started, it will make a second call to KuneriLite, this time to retrieve current GPS position (<strong>klCommand=read</strong>)</li>
</ul>
<p>This second call to KuneriLite will call <strong>gpsDataRead() handler</strong>, defined below:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> gpsDataRead<span style="color: #66cc66;">&#40;</span>res:<span style="color: #0066CC;">LoadVars</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>res.<span style="color: #006600;">klError</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>res.<span style="color: #006600;">klPosLatitude</span> <span style="color: #66cc66;">!</span>= <span style="color: #0066CC;">undefined</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> lat = res.<span style="color: #006600;">klPosLatitude</span>;
			<span style="color: #000000; font-weight: bold;">var</span> lng = res.<span style="color: #006600;">klPosLongitude</span>;
&nbsp;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;POSITION: &quot;</span> + lat + <span style="color: #ff0000;">&quot;, &quot;</span> + lng<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			loadMap<span style="color: #66cc66;">&#40;</span>lat, lng<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #66cc66;">&#123;</span>
			kuneriLoad<span style="color: #66cc66;">&#40;</span>kuneriPath + <span style="color: #ff0000;">'GPS?klCommand=read'</span>, gpsDataRead<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #66cc66;">&#123;</span>
		kuneriError<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Error retrieving GPS position!&quot;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>This handler, as above, will check if there is any error raised by KuneriLite and, if not, will check if latitude and longitude coordinates are available, by checking response <strong>klPosLatitude and klPosLongitude property</strong> values. If they&#8217;re not available, a new call to <strong>read klCommand</strong> is done, otherwise the following <strong>loadMap()</strong> function is called.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> loadMap<span style="color: #66cc66;">&#40;</span>lat:<span style="color: #0066CC;">Number</span>, lng:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> mapClip:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">createEmptyMovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'mapClip'</span>, <span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getNextHighestDepth</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	mapClip.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">0</span>;
	mapClip.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> mapWidth = <span style="color: #cc66cc;">240</span>;
	<span style="color: #000000; font-weight: bold;">var</span> mapHeight = <span style="color: #cc66cc;">280</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> loader:<span style="color: #0066CC;">MovieClipLoader</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClipLoader</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> mapUrl:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">'http://maps.google.com/staticmap?center='</span> +
		lat + <span style="color: #ff0000;">','</span> + lng + <span style="color: #ff0000;">'&amp;amp;format=jpg&amp;amp;zoom=8&amp;amp;size='</span> +
		mapWidth + <span style="color: #ff0000;">'x'</span> + mapHeight + <span style="color: #ff0000;">'&amp;amp;key='</span> + apiKey;
&nbsp;
	loader.<span style="color: #0066CC;">loadClip</span><span style="color: #66cc66;">&#40;</span>mapUrl, mapClip<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The above function:</p>
<ul>
<li> attaches a <strong>new empty movie clip </strong>to movie root</li>
<li> places it to coordinates (0,0)</li>
<li> use a <strong>MovieClipLoader </strong>to load a 240&#215;280 map image, in jpeg format, in the empty clip</li>
</ul>
<p>Done that, you can actually test your FlashLite movie</p>
<h3>Test your FlashLite application</h3>
<h4>Test on PC</h4>
<p>To test your application without deploying on real device, you must follow these simple steps:</p>
<ul>
<li> <strong>Start KuneriLite emulator</strong> with default settings (port: 1001, key: Basic)</li>
<li><strong> Start your FlashLite movie</strong></li>
<li> <strong>Press Find Me!</strong> and wait for your image to be loaded (of course, being an emulator, the GPS position will be not real <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</li>
</ul>
<p>For more infos about KuneriLite Emulator, you can go here: <a title="KuneriLite Emulator Wiki page" href="http://wiki.kunerilite.net/index.php?title=KuneriLite_Emulator" target="_blank">KuneriLite Emulator Wiki page</a></p>
<h4>Test on real device</h4>
<p>To test your app on real device, you must package your SIS application using KuneriLite Wizard, following these steps:</p>
<p><img src="http://www.jappit.com/images/blog/uploads/kunerimaps_wizard_shot.jpg" alt="KuneriLite Emulator screenshot" /></p>
<ul>
<li><strong> Export</strong> your FlashLite movie</li>
<li> Create a <strong>new KuneriLite project</strong></li>
<li> Enter application name and other data, <strong>checking GPS from the available plugins</strong></li>
<li> Check <strong>&#8220;Use external player&#8221;</strong> option if you developed for a development player (2.x or 3.x) and would like to launch the application using one of those players</li>
<li> It is also recommended to always check <strong>&#8220;Use stub&#8221;</strong> option</li>
<li> Select the exported SWF as project Main SWF</li>
</ul>
<p><strong>Note</strong>: to use GPS you should sign your application, specifying certificate, key and password in KuneriLite Wizard interface. Otherwise, your application will not be able to access GPS functionalities.</p>
<p>For more infos about KuneriLite Wizard, you can go here: <a title="KuneriLite Wizard Beginner's Guide" href="http://wiki.kunerilite.net/index.php?title=KuneriLite_Wizard_Beginner%27s_Guide" target="_blank">KuneriLite Wizard Beginner&#8217;s Guide</a></p>
<h3>Source code and resources</h3>
<ul>
<li>Download the FLA source of this tutorial here: <a title="KuneriLite FlashLite GoogleMaps application source code" href="http://www.jappit.com/uploads/src/KuneriGpsMap.zip">KuneriGpsMap.zip</a> (the downloadable version includes some code that could be useful to debug possible problems)</li>
<li>For further resources about using Google Maps in mobile applications, you can check this other article: <a title="How to use Google Maps data in mobile applications" href="http://wiki.forum.nokia.com/index.php/How_to_use_Google_Maps_data_in_mobile_applications" target="_blank">How to use Google Maps data in mobile applications</a></li>
<li>This article is available also on Forum Nokia Wiki: <a title="FlashLite Google Maps article on Forum Nokia Wiki" href="http://wiki.forum.nokia.com/index.php/Displaying_GPS_position_using_Google_Maps_images_in_FlashLite" target="_blank">Displaying GPS position using Google Maps images in FlashLite</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/12/displaying-gps-position-in-flashlite-using-google-static-maps-and-kunerilite/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Random thoughts after 2 months on KuneriLite</title>
		<link>http://www.jappit.com/blog/2008/05/20/random-thoughts-after-2-months-on-kunerilite/</link>
		<comments>http://www.jappit.com/blog/2008/05/20/random-thoughts-after-2-months-on-kunerilite/#comments</comments>
		<pubDate>Tue, 20 May 2008 13:20:26 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[flash lite]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[kunerilite]]></category>
		<category><![CDATA[mobile development]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=43</guid>
		<description><![CDATA[Yesterday I&#8217;ve finished 2 projects developed using FlashLite 3.0 in conjunction with KuneriLite. Now, it&#8217;s time for some considerations. About FlashLite My opinion: FlashLite is far from being a mature platform for mobile development. Why? No access to native phone functionalities. This means no GPS, no data storage (apart from text), no video/audio capture, and [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I&#8217;ve finished 2 projects developed using <a title="Adobe FlashLite website" href="http://www.adobe.com/products/flashlite/" target="_blank">FlashLite 3.0</a> in conjunction with <a title="KuneriLite website" href="http://www.kunerilite.net/" target="_blank">KuneriLite</a>. Now, it&#8217;s time for some considerations.</p>
<h3>About FlashLite</h3>
<p><img src="http://www.jappit.com/images/blog/uploads/flashlite_gallery.png" alt="FlashLite Gallery screenshot" width="469" height="149" /></p>
<p>My opinion: FlashLite is far from being a mature platform for mobile development. Why?</p>
<h4>No access to native phone functionalities.</h4>
<p>This means no GPS, no data storage (apart from text), no video/audio capture, and much more. Since one of mobile apps strengths is in its integration with the device itself, this sounds like a big limitation (but someway it&#8217;s something like first J2ME years). This could be due to a different perspective and target users/developers, but having a powerful platform like Flash being limited to casual games or screensavers looks a bit odd to me.</p>
<h4>Odd, senseless behavior.</h4>
<p>What happens if you try to load more that 5 resources together? They won&#8217;t load, simple.</p>
<p>Or want to quit your application? You can, but at conditions: user must press some key for quit to work and, even if he does, there&#8217;s the chance that the app simply won&#8217;t close.</p>
<p>And if a network or local resource, for example loaded via LoadVars, is not available? You&#8217;ll have a terrible popup telling the user that he has a &#8220;Problem with content: -6&#8243;, or other similar, anti-usability things.</p>
<h4>Security encounters insanity.</h4>
<p>Since FlashLite 3.0, there was a nice introduction, with the new player Security settings. About this there are good articles from <a title="The pain of Flash Lite 3.0" href="http://bloggy.kuneri.net/2008/05/13/the-pain-of-flash-lite-30/trackback/" target="_blank">Ugur</a> and <a title="Continued: The Pain of Flash Lite 3" href="http://www.orison.biz/blogs/chall3ng3r/?p=249" target="_blank">chall3ng3r</a> that point out this has caused problems in having, for example, an application loading both local and remote resources. Fortunately, there are workarounds that allow to overcome some of the limitations involved in this (like using the notorious &#8220;Trusted&#8221; folder), but we&#8217;re still far from painless development <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Good news under the sun.</h4>
<p><a title="Bill Perry website" href="http://www.flashdevices.net/" target="_blank">Bill Perry</a> from Adobe <a title="Flash Lite 3 Security Issue - Resolution Soon" href="http://www.flashdevices.net/2008/05/flash-lite-3-security-issue-resolution.html" target="_blank">posted back</a>, few days after the posts from Ugur and chall3ng3r, with the news that Adobe is working to solve some of the issues pointed out, and this is absolutely a welcome kind of feedback from Adobe team!</p>
<h3>About KuneriLite</h3>
<p><img src="http://www.jappit.com/images/blog/uploads/kunerilite_wizard.png" alt="KuneriLite Wizard screenshot" width="469" height="149" /></p>
<h4>Install, plug, use.</h4>
<p>When you must merge 2 technologies to overcome their own limitations, it&#8217;s already a pain. So, when you do it, you want simple, immediate tools, that would make your work easier, not harder. With <a title="KuneriLite website" href="http://www.kunerilite.net" target="_blank">KuneriLite</a> you have exacly this: an easy-to-use, understand and test tool. You have an intuitive <a title="KuneriLite Wizard" href="http://wiki.kunerilite.net/index.php?title=KuneriLite_Introduction#KuneriLite_Wizard" target="_blank">Wizard</a> that will allow you to create, setup and SIS package all your apps, and an <a title="KuneriLite emulator" href="http://wiki.kunerilite.net/index.php?title=KuneriLite_Emulator" target="_blank">emulator</a> for easy testing and debugging. This IS what we want!</p>
<h4>Support matters!</h4>
<p>Briefly said: KuneriLite team is fantastic! Having worked with their product for more than 2 months, I can say to be more than happy for their help and support. You can find all the infos you want on <a title="KuneriLite forum" href="http://forum.kuneri.net/index.php?board=29.0">their forums</a> an <a title="KuneriLite Wiki" href="http://wiki.kunerilite.net">Wiki pages</a>.</p>
<h4>Yes, but what?</h4>
<p>Ok, maybe you don&#8217;t know what KuneriLite is, so here&#8217;s a brief introduction: KuneriLite is a tool that allows you to access Symbian native functionalities from your FlashLite application. They (your FlashLite app and KuneriLite) will interact via simple HTTP requests, and results are returned in the classical form of key/value pairs. So said, integration with your app will be quite straightforward.</p>
<h3>Past, present and future.</h3>
<p>Mobile Development is currently undergoing a lot of changes, merging and shuffles.</p>
<p>FlashLite seems to be trying to find his way by merging with other technologies, from Java (see <a title="Jarpa website" href="http://www.i2tecnologia.com.br/jarpa/">Jarpa</a>) to Python (<a title="Flyer website" href="http://www.flyerframework.org/">FlyerFramework</a>) to Symbian C++ (<a title="KuneriLite website" href="http://www.kunerilite.net">KuneriLite</a>, <a title="Janus homepage" href="http://www.spaghettisort.com/janus/products-janus-symbian.html">Janus</a>, and others) and, why not, <a title="WebRuntime Nokia homepage" href="http://www.forum.nokia.com/main/resources/technologies/browsing/widgets.html">Web Runtime</a>. Far from having a definite solution, there&#8217;s a lot to see and experiment.</p>
<p>And we&#8217;re here to do it <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/05/20/random-thoughts-after-2-months-on-kunerilite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New KuneriLite version with cool improvements</title>
		<link>http://www.jappit.com/blog/2008/04/28/new-kunerilite-version-with-cool-improvements/</link>
		<comments>http://www.jappit.com/blog/2008/04/28/new-kunerilite-version-with-cool-improvements/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 11:00:17 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[flash lite]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[kunerilite]]></category>
		<category><![CDATA[s60]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=24</guid>
		<description><![CDATA[KuneriLite is a great tool to extend FlashLite functionalities adding support for native features like local filesystem read/write, camera recording, accelerometer capabilities and much more. All these without the need to have any Symbian knowledge. Practically, you interact with KuneriLite engine via localhost calls. For example, if you want to get recursive folder listing starting [...]]]></description>
			<content:encoded><![CDATA[<p><a title="KuneriLite website" href="http://www.kunerilite.net" target="_blank">KuneriLite</a> is a great tool to extend FlashLite functionalities adding support for native features like local filesystem read/write, camera recording, accelerometer capabilities and much more. All these without the need to have any Symbian knowledge.</p>
<p>Practically, you interact with KuneriLite engine via localhost calls. For example, if you want to get recursive folder listing starting from current application base path, you can simply do:</p>
<pre>loadVariables("http://127.0.0.1:1001/Basic/file?
klCommand=dir&amp;klPath=\\&amp;klArgs=/s", targetMc);</pre>
<p>Their tool comes with an integrated wizard and an emulator, to be used with Symbian S60 3rd edition SDK Maintenance Release, to allow full development without the need of a real device.</p>
<p><img src="http://www.jappit.com/images/blog/uploads/kunerilite.png" alt="KuneriLite logo" /></p>
<p>Now they&#8217;ve just released 0.9.6.1 version, that fixes issues with Flash Lite 3 and add new cool features, as you can read on <a title="KuneriLite new version blog post" href="http://bloggy.kuneri.net/2008/04/25/kunerilite-0961-released/trackback/" target="_blank">their blog</a>, and it&#8217;s more than ever worth a try!</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/04/28/new-kunerilite-version-with-cool-improvements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>KuneriLite: Nokia N95 advert with Microsoft Paint, cool!</title>
		<link>http://www.jappit.com/blog/2008/04/09/kunerilite-microsoft-paint-advert-cool/</link>
		<comments>http://www.jappit.com/blog/2008/04/09/kunerilite-microsoft-paint-advert-cool/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 08:37:19 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[flash lite]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[advert]]></category>
		<category><![CDATA[kunerilite]]></category>
		<category><![CDATA[paint]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/2008/04/09/kunerilite-microsoft-paint-advert-cool/</guid>
		<description><![CDATA[KuneriLite is a superb tool to build rich applications on Symbian S60 phones using FlashLite, allowing to access native phone funcionalities that would be otherwise unaccessible. I&#8217;m currently developing some apps with it, and I&#8217;ll post more on this later. By now, just take a look at how cool is this advert made by KuneriLite [...]]]></description>
			<content:encoded><![CDATA[<p>KuneriLite is a superb tool to build rich applications on Symbian S60 phones using FlashLite, allowing to access native phone funcionalities that would be otherwise unaccessible. I&#8217;m currently developing some apps with it, and I&#8217;ll post more on this later.</p>
<p>By now, just take a look at how cool is <a href="http://bloggy.kuneri.net/2008/04/07/kunerilite-advert-with-n95-8gb/" title="KuneriLite advert">this advert made by KuneriLite team</a>, using Microsoft Paint.. I think it&#8217;s terrific!</p>
<p><a href="http://digg.com/software/Nokia_N95_8GB_hand_drawn_with_MS_Paint_and_mouse" title="Digg KuneriLite advert">It&#8217;s absolutely worth a Digg</a>!</p>
<p><strong>Edit:</strong> you can use also this <a href="http://digg.com/comics_animation/Proof_You_don_t_need_a_lot_to_create_wonders" title="Digg KuneriLite Paint advert">new Digg link</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/04/09/kunerilite-microsoft-paint-advert-cool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

