<?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"
	>

<channel>
	<title>J2ME, Flash Lite, Symbian, Iphone, Android and Ajax news, tutorials, source code</title>
	<atom:link href="http://www.jappit.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jappit.com/blog</link>
	<description>J2ME, Flash Lite, Symbian, Iphone, Android, Ajax and other stuff..</description>
	<pubDate>Tue, 01 Jul 2008 17:30:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<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 photos to Flickr we&#8217;ll [...]]]></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">function getApiSignature<span style="color: #66cc66;">&#40;</span>args:<span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	var authSig:<span style="color: #aaaadd; font-weight: bold;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>var key:<span style="color: #aaaadd; font-weight: bold;">String</span> in args<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		authSig.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span>key + args<span style="color: #66cc66;">&#91;</span>key<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
	<span style="color: #66cc66;">&#125;</span>
	authSig = authSig.<span style="color: #006600;">sort</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	var apiSig:<span style="color: #aaaadd; font-weight: bold;">String</span> = <span style="color: #000000; font-weight: bold;">this</span>._md5.<span style="color: #006600;">hash</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&lt;</span>API_SECRET<span style="color: #66cc66;">&gt;</span> + authSig.<span style="color: #006600;">join</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">return</span> apiSig<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#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>
		</item>
		<item>
		<title>How to add sliding transitions between Canvas in J2ME</title>
		<link>http://www.jappit.com/blog/2008/06/23/how-to-add-sliding-transitions-between-canvas-in-j2me/</link>
		<comments>http://www.jappit.com/blog/2008/06/23/how-to-add-sliding-transitions-between-canvas-in-j2me/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 12:39:03 +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[symbian]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[canvas]]></category>

		<category><![CDATA[fx]]></category>

		<category><![CDATA[java me]]></category>

		<category><![CDATA[sliding animations]]></category>

		<category><![CDATA[transitions]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=53</guid>
		<description><![CDATA[Today we&#8217;ll see a simple way to add sliding transition between Canvas in a Java ME application. Just take a look at it in the emulator page to see how it performs: Canvas sliding transitions in action!

The source code
FxBaseCanvas
First of all, we know that Canvas paint() method is protected, so, to access it from the [...]]]></description>
			<content:encoded><![CDATA[<p>Today we&#8217;ll see a simple way to add <strong>sliding transition between Canvas</strong> in a Java ME application. Just take a look at it in the emulator page to see how it performs: <a title="Java ME Canvas sliding transition in action" href="http://www.jappit.com/index.php?page=emulator&amp;midlet=canvas_sliding_fx">Canvas sliding transitions in action</a>!</p>
<p><img src="http://www.jappit.com/images/blog/uploads/j2me_canvas_sliding_fx.jpg" alt="j2me canvas sliding transition screenshot" width="247" height="185" /></p>
<h3>The source code</h3>
<h4>FxBaseCanvas</h4>
<p>First of all, we know that <strong>Canvas</strong> <strong>paint()</strong> method is protected, so, to access it from the class we&#8217;ll build, we must extend its visibility by <strong>extending Canvas class itself</strong>. We&#8217;ll do it by defining our <strong>FxBaseClass</strong> in this simple way:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #a1a100;">import javax.microedition.lcdui.Canvas;</span>
<span style="color: #a1a100;">import javax.microedition.lcdui.Graphics;</span>
<span style="color: #a1a100;">import javax.microedition.lcdui.Canvas;</span>
<span style="color: #a1a100;">import javax.microedition.lcdui.Graphics;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FxBaseCanvas <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #aaaadd; font-weight: bold;">Canvas</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> paint<span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">Graphics</span> g<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h4>CanvasSlideFx</h4>
<p>Now, we start building our <strong>CanvasSlideFx </strong>class, that will extend Canvas itself. We start defining some useful properties:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #808080; font-style: italic;">// time related properties</span>
<span style="color: #993333;">long</span> startTime = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
<span style="color: #993333;">long</span> duration = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// current state of the transition</span>
<span style="color: #993333;">boolean</span> running = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// direction of sliding</span>
<span style="color: #993333;">int</span> direction = LEFT<span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// the previous and next Canvas instances</span>
FxBaseCanvas fromCanvas = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">;</span>
FxBaseCanvas toCanvas = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// the current Display object</span>
Display display = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// properties used to correctly place the 2 Canvas</span>
<span style="color: #993333;">int</span> deltaX = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
<span style="color: #993333;">int</span> deltaY = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Now, we define our class constructor, that will initialize coordinate properties according to the specified transition direction. The detailed argument list is:</p>
<ul>
<li>The <strong>current Display object</strong>, that will be used to retrieve the current displayed Canvas, and to set the next one</li>
<li><strong>The destination Canvas</strong>, that will extend the previously defined FxBaseCanvas class</li>
<li>The transition <strong>direction</strong> (one of Canvas.UP, RIGHT, DOWN or LEFT)</li>
<li>The transition <strong>duration</strong>, in milliseconds</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">public</span> CanvasSlideFx<span style="color: #66cc66;">&#40;</span>Display display, FxBaseCanvas toCanvas, <span style="color: #993333;">int</span> direction, <span style="color: #993333;">long</span> duration<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">display</span> = display<span style="color: #66cc66;">;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">fromCanvas</span> = <span style="color: #66cc66;">&#40;</span>FxBaseCanvas<span style="color: #66cc66;">&#41;</span>display.<span style="color: #006600;">getCurrent</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">toCanvas</span> = toCanvas<span style="color: #66cc66;">;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">direction</span> = direction<span style="color: #66cc66;">;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">duration</span> = duration<span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span>direction<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">case</span> UP:
		deltaY = - getHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #66cc66;">;</span>
	<span style="color: #b1b100;">case</span> RIGHT:
		deltaX = getWidth<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #66cc66;">;</span>
	<span style="color: #b1b100;">case</span> DOWN:
		deltaY = getHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #66cc66;">;</span>
	<span style="color: #b1b100;">case</span> LEFT:
		deltaX = - getWidth<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #66cc66;">;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Now, we define a <strong>startTransition()</strong> method, that will actually start the animation. To implement the animation itself, we let our class implement <strong>Runnable</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #993333;">void</span> startTransition<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">startTime</span> = <span style="color: #aaaadd; font-weight: bold;">System</span>.<span style="color: #006600;">currentTimeMillis</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	running = <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">Thread</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>And here&#8217;s the <strong>run()</strong> method implementation, that we must implement from Runnable interface. As long as the animation is running, we will repaint our animated Canvas, with a given interval of 50 milliseconds (but you can freely change this). When it finishes (so, running is false), we will exit the main loop and <strong>set the current Displayable</strong> to our <strong>toCanvas</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> run<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">try</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>running<span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			repaint<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">synchronized</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				wait<span style="color: #66cc66;">&#40;</span>50L<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">catch</span><span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">Exception</span> e<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
	<span style="color: #66cc66;">&#125;</span>
	display.<span style="color: #006600;">setCurrent</span><span style="color: #66cc66;">&#40;</span>toCanvas<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Finally, we have our <strong>paint()</strong> method, that will actually paint our transition. It will do this by <strong>painting both the source and the destination Canvas</strong>, translating them according to the transition direction, and to the elapsed time.</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #993333;">void</span> paint<span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">Graphics</span> g<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>running<span style="color: #66cc66;">&#41;</span>
		startTransition<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #993333;">long</span> diff = <span style="color: #aaaadd; font-weight: bold;">System</span>.<span style="color: #006600;">currentTimeMillis</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> - startTime<span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>diff <span style="color: #66cc66;">&gt;</span>= duration<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		running = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">;</span>
&nbsp;
		diff = duration<span style="color: #66cc66;">;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #993333;">int</span> perc = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span> <span style="color: #66cc66;">*</span> diff / duration<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> dx = deltaX <span style="color: #66cc66;">*</span> perc / <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">;</span>
	<span style="color: #993333;">int</span> dy = deltaY <span style="color: #66cc66;">*</span> perc / <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">;</span>
&nbsp;
	g.<span style="color: #006600;">translate</span><span style="color: #66cc66;">&#40;</span>dx, dy<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	fromCanvas.<span style="color: #006600;">paint</span><span style="color: #66cc66;">&#40;</span>g<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	g.<span style="color: #006600;">translate</span><span style="color: #66cc66;">&#40;</span>- deltaX, - deltaY<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	toCanvas.<span style="color: #006600;">paint</span><span style="color: #66cc66;">&#40;</span>g<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	g.<span style="color: #006600;">translate</span><span style="color: #66cc66;">&#40;</span>deltaX - dx, deltaY - dy<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h3>How to use it?</h3>
<p>Now we&#8217;ll see how to <strong>integrate the CanvasSlideFx within an existing code</strong> that already uses Canvas.<br />
So, let&#8217;s assume that our application currently has, somewhere in its code, these lines:</p>

<div class="wp_syntax"><div class="code"><pre class="java">MyCanvas firstCanvas = <span style="color: #000000; font-weight: bold;">new</span> MyCanvas<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
Display.<span style="color: #006600;">getDisplay</span><span style="color: #66cc66;">&#40;</span>myMidlet<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setCurrent</span><span style="color: #66cc66;">&#40;</span>firstCanvas<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
...
<span style="color: #808080; font-style: italic;">//and somewhere else</span>
MyOtherCanvas secondCanvas = <span style="color: #000000; font-weight: bold;">new</span> MyOtherCanvas<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
Display.<span style="color: #006600;">getDisplay</span><span style="color: #66cc66;">&#40;</span>myMidlet<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setCurrent</span><span style="color: #66cc66;">&#40;</span>secondCanvas<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>where MyCanvas and MyOtherCanvas will likely extend Canvas.</p>
<p>Now here are the required steps to integrate transitions in our code:</p>
<ol>
<li> First of all, we must make <strong>MyCanvas and MyOtherCanvas extend FxBaseCanvas </strong>instead of directly Canvas. So, we&#8217;ll have:

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyCanvas extend FxBaseCanvas ...</pre></div></div>

</li>
<li> Then, let&#8217;s say we want to animate the transition between firstCanvas and secondCanvas, we will <strong>remove the code</strong>:

<div class="wp_syntax"><div class="code"><pre class="java">Display.<span style="color: #006600;">getDisplay</span><span style="color: #66cc66;">&#40;</span>myMidlet<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setCurrent</span><span style="color: #66cc66;">&#40;</span>secondCanvas<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>and <strong>replace it </strong>with:</p>

<div class="wp_syntax"><div class="code"><pre class="java">CanvasSlideFx fxCanvas = <span style="color: #000000; font-weight: bold;">new</span> CanvasSlideFx<span style="color: #66cc66;">&#40;</span>
	Display.<span style="color: #006600;">getDisplay</span><span style="color: #66cc66;">&#40;</span>myMidlet<span style="color: #66cc66;">&#41;</span>,
	secondCanvas,
	<span style="color: #aaaadd; font-weight: bold;">Canvas</span>.<span style="color: #006600;">LEFT</span>,
	500L
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
Display.<span style="color: #006600;">getDisplay</span><span style="color: #66cc66;">&#40;</span>myMidlet<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setCurrent</span><span style="color: #66cc66;">&#40;</span>fxCanvas<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

</li>
<li> and we&#8217;ve done it! <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<h3>Resources and download</h3>
<p>You can download the code explained in this article with the following links:</p>
<ul>
<li><a title="FxBaseCanvas class source code" href="http://www.jappit.com/uploads/src/FxBaseCanvas.java">FxBaseCanvas.java</a>: our base class extending Canvas</li>
<li><a title="CanvasSlideFx class source code" href="http://www.jappit.com/uploads/src/CanvasSlideFx.java">CanvasSlideFx.java</a>: the class used to implement the sliding transition</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/23/how-to-add-sliding-transitions-between-canvas-in-j2me/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I&#8217;m a Forum Nokia Super Contributor (with a custom Avatar :))</title>
		<link>http://www.jappit.com/blog/2008/06/23/im-a-forum-nokia-super-contributor-with-a-custom-avatar/</link>
		<comments>http://www.jappit.com/blog/2008/06/23/im-a-forum-nokia-super-contributor-with-a-custom-avatar/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 11:03:15 +0000</pubDate>
		<dc:creator>pit</dc:creator>
		
		<category><![CDATA[cool stuff]]></category>

		<category><![CDATA[nokia]]></category>

		<category><![CDATA[custom avatar]]></category>

		<category><![CDATA[discussion boards]]></category>

		<category><![CDATA[forum nokia]]></category>

		<category><![CDATA[super contributor]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=52</guid>
		<description><![CDATA[Just a post with some self celebration  
I&#8217;ve recently hit the target of 500 posts on Forum Nokia Discussion Boards, and so I&#8217;ve acquired the Super Contributor title! Here&#8217;s the related post, but the best thing is absolutely the customizable avatar bonus, so here it is:

My design skills are not that good, don&#8217;t you [...]]]></description>
			<content:encoded><![CDATA[<p>Just a post with some self celebration <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;ve recently hit the target of 500 posts on <a title="Forum Nokia Discussion Boards" href="http://discussion.forum.nokia.com/" target="_blank">Forum Nokia Discussion Boards</a>, and so I&#8217;ve acquired the <strong>Super Contributor</strong> title! Here&#8217;s the <a title="Jappit Super Contributor Forum Nokia thread" href="http://discussion.forum.nokia.com/forum/showthread.php?p=429655" target="_blank">related post</a>, but the best thing is absolutely the customizable avatar bonus, so here it is:</p>
<p><img src="http://www.jappit.com/images/sprites/cap_man1.png" alt="Jappit Avatar" width="48" height="48" /></p>
<p>My design skills are <em>not that good</em>, don&#8217;t you think? <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Meanwhile, also a new <a title="Forum Nokia Champion homepage" href="http://www.forum.nokia.com/main/forum_nokia_champion/" target="_blank"><span style="text-decoration: line-through;">Forum Nokia Champion</span></a> <strong>Champion of the Month</strong> has been proclamed, so <strong>kudos to <a title="Pankaj Nathani is a Forum Nokia Champion!" href="http://www.forum.nokia.com/main/forum_nokia_champion/forum_nokia_champions/Pankaj_Nathani.html" target="_blank">Pankaj Nathani</a></strong> (already <strong>Forum Nokia Champion</strong> at the beginning of this year) for his great contributions and participation in <strong>Forum Nokia community</strong>! Keep up the good work!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/23/im-a-forum-nokia-super-contributor-with-a-custom-avatar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to create a color fading text in J2ME</title>
		<link>http://www.jappit.com/blog/2008/06/18/create-color-fading-text-in-j2me/</link>
		<comments>http://www.jappit.com/blog/2008/06/18/create-color-fading-text-in-j2me/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 11:40:54 +0000</pubDate>
		<dc:creator>pit</dc:creator>
		
		<category><![CDATA[j2me]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[colors]]></category>

		<category><![CDATA[effects]]></category>

		<category><![CDATA[fading]]></category>

		<category><![CDATA[fx]]></category>

		<category><![CDATA[text]]></category>

		<category><![CDATA[transitions]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=51</guid>
		<description><![CDATA[It&#8217;s time for new effects!  
Today we&#8217;ll see how to implement and and use text that changes multiple colors with a fading effect. You can see it in action here: J2ME text color fade effect in action.

So, let&#8217;s start defining our ColorFadeText class.
The code
We start defining the necessary properties:

//will hold the colors to fade
int&#91;&#93; [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for new effects! <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Today we&#8217;ll see how to implement and and use <strong>text that changes multiple colors with a fading effect</strong>. You can see it in action here: <a title="Sample midlet using ColorFadeText class" href="http://www.jappit.com/index.php?page=emulator&#038;midlet=color_fade_text">J2ME text color fade effect in action</a>.</p>
<p><img src="http://www.jappit.com/images/blog/uploads/j2me_color_fade_text.gif" alt="Color Fading Text screenshot" /></p>
<p>So, let&#8217;s start defining our <strong>ColorFadeText </strong>class.</p>
<h3>The code</h3>
<p>We start defining the necessary <strong>properties</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #808080; font-style: italic;">//will hold the colors to fade</span>
<span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> colors = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//duration of a single fade</span>
<span style="color: #993333;">int</span> fadeDuration = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//effect start time</span>
<span style="color: #993333;">long</span> startTime = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//property used to check if effect has started</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">boolean</span> started = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//the text to be drawn</span>
<span style="color: #aaaadd; font-weight: bold;">String</span> text = <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Now, we define the main <strong>constructor</strong>, that will accept the following arguments:</p>
<ul>
<li>the <strong>text </strong>to be drawn</li>
<li>an int[] array containing the <strong>colors </strong>to fade into</li>
<li>the <strong>duration </strong>of a single fade</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">public</span> ColorFadeText<span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">String</span> text, <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> colors, <span style="color: #993333;">int</span> fadeDuration<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>colors.<span style="color: #006600;">length</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">IllegalArgumentException</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;You must define at least 1 color&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">text</span> = text<span style="color: #66cc66;">;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">colors</span> = colors<span style="color: #66cc66;">;</span>
	<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">fadeDuration</span> = fadeDuration<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The effect <strong>start()</strong> method will simply set the startTime value to current time and the started property to true</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> start<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	startTime = <span style="color: #aaaadd; font-weight: bold;">System</span>.<span style="color: #006600;">currentTimeMillis</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
	started = <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Then, we have the <strong>paint()</strong> method, that will be used to paint the text on the given Graphics instance:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> paint<span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">Graphics</span> g, <span style="color: #993333;">int</span> x, <span style="color: #993333;">int</span> y, <span style="color: #993333;">int</span> anchor<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>started<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #993333;">long</span> diff = <span style="color: #aaaadd; font-weight: bold;">System</span>.<span style="color: #006600;">currentTimeMillis</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> - startTime<span style="color: #66cc66;">;</span>
&nbsp;
		<span style="color: #993333;">int</span> module = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>diff <span style="color: #66cc66;">%</span> fadeDuration<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
		<span style="color: #993333;">int</span> colorIndex = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>diff / fadeDuration<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">%</span> colors.<span style="color: #006600;">length</span><span style="color: #66cc66;">;</span>
&nbsp;
		<span style="color: #993333;">int</span> midColor = midColor<span style="color: #66cc66;">&#40;</span>
			colors<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#40;</span>colorIndex + <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">%</span> colors.<span style="color: #006600;">length</span><span style="color: #66cc66;">&#93;</span>,
			colors<span style="color: #66cc66;">&#91;</span>colorIndex<span style="color: #66cc66;">&#93;</span>,
			module,
			fadeDuration
		<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
		g.<span style="color: #006600;">setColor</span><span style="color: #66cc66;">&#40;</span>midColor<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #66cc66;">&#123;</span>
		g.<span style="color: #006600;">setColor</span><span style="color: #66cc66;">&#40;</span>colors<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	g.<span style="color: #006600;">drawString</span><span style="color: #66cc66;">&#40;</span>text, x, y, anchor<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The following utility method will be the one actually used <strong>to get the current text color</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">int</span> midColor<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> color1, <span style="color: #993333;">int</span> color2, <span style="color: #993333;">int</span> prop, <span style="color: #993333;">int</span> max<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #993333;">int</span> red =
		<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>color1 <span style="color: #66cc66;">&gt;&gt;</span> <span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> 0xff<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> prop +
		<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>color2 <span style="color: #66cc66;">&gt;&gt;</span> <span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> 0xff<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span>max - prop<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> / max<span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> green =
		<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>color1 <span style="color: #66cc66;">&gt;&gt;</span> <span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> 0xff<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> prop +
		<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>color2 <span style="color: #66cc66;">&gt;&gt;</span> <span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> 0xff<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span>max - prop<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> / max<span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> blue =
		<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>color1 <span style="color: #66cc66;">&gt;&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> 0xff<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> prop +
		<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>color2 <span style="color: #66cc66;">&gt;&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;</span> 0xff<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span>max - prop<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> / max<span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #993333;">int</span> color = red <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #cc66cc;">16</span> | green <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #cc66cc;">8</span> | blue<span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">return</span> color<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h3>How to use it?</h3>
<p>Using the <strong>ColorFadeText </strong>object is quite simple, since it&#8217;ll be very similar to use a common String. Just follow this plain steps.</p>
<p><strong>1. </strong><strong>Create </strong>a ColorFadeText instance</p>

<div class="wp_syntax"><div class="code"><pre class="java">ColorFadeText text = <span style="color: #000000; font-weight: bold;">new</span> ColorFadeText<span style="color: #66cc66;">&#40;</span>
	<span style="color: #ff0000;">&quot;I'M A FADING TEXT!&quot;</span>,
	<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#123;</span>0xff0000, 0x00ff00, 0x0000ff, 0xff00ff<span style="color: #66cc66;">&#125;</span>,
	<span style="color: #cc66cc;">1000</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p><strong>2. </strong><strong>Start </strong>it&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java">text.<span style="color: #006600;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p><strong>3. </strong>And then, in your Canvas paint() method, <strong>paint </strong>it, using the same arguments used by Graphics drawString() method (adding a reference to the Graphics instance of course):</p>

<div class="wp_syntax"><div class="code"><pre class="java">text.<span style="color: #006600;">paint</span><span style="color: #66cc66;">&#40;</span>g,
	getWidth<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;">2</span>,
	<span style="color: #cc66cc;">2</span>,
	<span style="color: #aaaadd; font-weight: bold;">Graphics</span>.<span style="color: #006600;">HCENTER</span> | <span style="color: #aaaadd; font-weight: bold;">Graphics</span>.<span style="color: #006600;">TOP</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Just a side note: since it&#8217;s an animated effect, you&#8217;ll need to <strong>repaint it quite frequently</strong>, so, for example, you can use a Thread to periodically call Canvas repaint() method.</p>
<h3>Source code download</h3>
<p>You can download <strong>source code </strong>of ColorFadeText, and of a sample Canvas that makes use of it:</p>
<ul>
<li><a title="ColorFadeText class source code" href="http://www.jappit.com/uploads/src/ColorFadeText.java">ColorFadeText.java</a>: main class source code</li>
<li><a title="AnimatedTextCanvas class source code" href="http://www.jappit.com/uploads/src/AnimatedTextCanvas.java">AnimatedTextCanvas.java</a>: a Canvas using the ColorFadeText object</li>
</ul>
<p>This article is also available on <strong>Forum Nokia Wiki</strong>: <a title="How to create a color fading text in Java ME" href="http://wiki.forum.nokia.com/index.php/How_to_create_a_color_fading_text_in_Java_ME" target="_blank">How to create a color fading text in Java ME</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/18/create-color-fading-text-in-j2me/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Forum Nokia 2008 Code Example Challenge Winners announced!</title>
		<link>http://www.jappit.com/blog/2008/06/13/forum-nokia-2008-code-example-challenge-winners-announced/</link>
		<comments>http://www.jappit.com/blog/2008/06/13/forum-nokia-2008-code-example-challenge-winners-announced/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 11:46:11 +0000</pubDate>
		<dc:creator>pit</dc:creator>
		
		<category><![CDATA[cool stuff]]></category>

		<category><![CDATA[flash lite]]></category>

		<category><![CDATA[j2me]]></category>

		<category><![CDATA[nokia]]></category>

		<category><![CDATA[code challenge]]></category>

		<category><![CDATA[contest winners]]></category>

		<category><![CDATA[forum nokia]]></category>

		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=50</guid>
		<description><![CDATA[2008 Code Example Challenge took place on Forum Nokia Wiki, and reached the goal of nearly 300 articles (code examples and applications)  submitted by more than 50 developers around the globe.

And finally&#8230; here are the Winners!

Overall Winner and Location Based Services (LBS): Den Grigorenko
Flash Lite: Faisal Iqbal and Hayden Porter
Web Runtime (WRT): Dou Yongwang

Also, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Forum Nokia 2008 Code Example Challenge" href="http://wiki.forum.nokia.com/index.php/2008_Code_Example_Challenge" target="_blank">2008 Code Example Challenge</a> took place on <a title="Forum Nokia Wiki" href="http://wiki.forum.nokia.com/" target="_blank">Forum Nokia Wiki</a>, and reached the goal of nearly <strong>300 articles </strong>(code examples and applications)  submitted by more than <strong>50 developers</strong> around the globe.</p>
<p><img src="http://www.jappit.com/images/blog/uploads/2008_code_example_winners.gif" alt="2008 Code Example Challenge winners banner" width="450" height="150" /></p>
<p>And finally&#8230; here are the Winners!</p>
<ul>
<li><strong>Overall Winner and Location Based Services (LBS)</strong>: <a title="Den123 Wiki Page" href="http://wiki.forum.nokia.com/index.php/User:Den123">Den Grigorenko</a></li>
<li><strong>Flash Lite</strong>: <a title="Call3ng3r Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Chall3ng3r" target="_blank">Faisal Iqbal</a> and <a title="Hp3 Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Hp3" target="_blank">Hayden Porter</a></li>
<li><strong>Web Runtime (WRT)</strong>: <a title="Dougcn Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Dougcn" target="_blank">Dou Yongwang</a></li>
</ul>
<p>Also, special prizes (<a title="Nokia 6220 specifications" href="http://www.forum.nokia.com/devices/6220_classic" target="_blank">Nokia 6220 Classic Devices</a>) were given to: <a title="Rahean Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Raheal_akh">Raheal Akhtar</a>, <a title="David Caabeiro Wiki page" href="http://wiki.forum.nokia.com/index.php/User:David.caabeiro" target="_blank">David Caabeiro</a>, <a title="Geri Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Geri-m" target="_blank">Gerald Madlmayr</a>, <a title="Felipe Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Felipebzr" target="_blank">Felipe Andrade</a>, <a title="Olympio Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Olympio" target="_blank">Olympio Cipriano</a> and&#8230; <a title="Jappit Wiki page" href="http://wiki.forum.nokia.com/index.php/User:Jappit" target="_blank">me</a> <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <strong>I&#8217;m too happy!!</strong></p>
<p>If you want to take a look at the impressive list of all articles submitted by developers for the whole contest, take a look here: <a title="2008 Code Example Challenge article list" href="http://wiki.forum.nokia.com/index.php/Articles_by_2008_Code_Example_Challenge_Winners" target="_blank">2008 Code Example Challenge article list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/13/forum-nokia-2008-code-example-challenge-winners-announced/feed/</wfw:commentRss>
		</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[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 for your API key.
Download and [...]]]></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"><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"><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">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"> http://wiki.kunerilite.net/index.php?title=GPS_plugin</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"><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"><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 :))</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>
		</item>
		<item>
		<title>Google Maps mobile tutorial is Wiki article of the Month!</title>
		<link>http://www.jappit.com/blog/2008/06/11/google-maps-mobile-tutorial-is-wiki-article-of-the-month/</link>
		<comments>http://www.jappit.com/blog/2008/06/11/google-maps-mobile-tutorial-is-wiki-article-of-the-month/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 12:30:20 +0000</pubDate>
		<dc:creator>pit</dc:creator>
		
		<category><![CDATA[cool stuff]]></category>

		<category><![CDATA[mobile]]></category>

		<category><![CDATA[nokia]]></category>

		<category><![CDATA[geocoding]]></category>

		<category><![CDATA[google maps]]></category>

		<category><![CDATA[localization]]></category>

		<category><![CDATA[mobile mapping]]></category>

		<category><![CDATA[static maps]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=48</guid>
		<description><![CDATA[I&#8217;m really honored that another article, published on Forum Nokia Wiki, has been selected as Article of the Month!

As the previous one, this also is related to Google Maps usage in mobile applications, and you can read it here: How to use Google Maps data in mobile applications.
As its name says, It&#8217;s an introductory article [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really honored that <a title="How to use Google Maps data in mobile applications wiki article" href="http://wiki.forum.nokia.com/index.php/How_to_use_Google_Maps_data_in_mobile_applications" target="_blank">another article</a>, published on <a title="Forum Nokia Wiki" href="http://wiki.forum.nokia.com/" target="_blank">Forum Nokia Wiki</a>, has been selected as <strong>Article of the Month</strong>!</p>
<p><img src="http://www.jappit.com/images/blog/uploads/gmaps_article_of_month.jpg" alt="Google Maps article of the month" /></p>
<p>As the <a title="J2ME Google Maps API article of the week blog post" href="http://www.jappit.com/blog/2008/06/09/j2me-google-maps-api-is-article-of-the-week-on-forum-nokia/">previous one</a>, this also is related to <strong>Google Maps usage in mobile applications</strong>, and you can read it here: <a title="How to use Google Maps data in mobile applications Wiki article" 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>.</p>
<p>As its name says, It&#8217;s an introductory article on how to use Google Maps services, in particular the <strong><a title="Google Maps geocoding service" href="http://code.google.com/apis/maps/documentation/services.html#Geocoding" target="_blank">geocoding</a></strong> and <strong><a title="Google Static Maps" href="http://code.google.com/apis/maps/documentation/staticmaps/" target="_blank">static maps</a></strong> ones, from a mobile application, where standard Google Maps API code is not suitable (since it is thought for web based and Ajax&#8217;d apps). Its content does not focus on any particular programming language, but gives <strong>base guidelines</strong> to use those services using <a title="Representational State Transfer" href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">REST</a>.</p>
<p>So&#8230; any kind of feedbacks is welcome! <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/06/11/google-maps-mobile-tutorial-is-wiki-article-of-the-month/feed/</wfw:commentRss>
		</item>
		<item>
		<title>J2ME Google Maps API is article of the week on Forum Nokia!</title>
		<link>http://www.jappit.com/blog/2008/06/09/j2me-google-maps-api-is-article-of-the-week-on-forum-nokia/</link>
		<comments>http://www.jappit.com/blog/2008/06/09/j2me-google-maps-api-is-article-of-the-week-on-forum-nokia/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 13:47:11 +0000</pubDate>
		<dc:creator>pit</dc:creator>
		
		<category><![CDATA[j2me]]></category>

		<category><![CDATA[mobile]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[geocoding]]></category>

		<category><![CDATA[google maps]]></category>

		<category><![CDATA[google maps api]]></category>

		<category><![CDATA[map static images]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=47</guid>
		<description><![CDATA[I&#8217;m really happy to announce that my J2ME Google Maps API article on Forum Nokia Wiki has been selected as Article of the Week!  

And, to celebrate this event, I&#8217;ve added a brand new feature to my article that will allow you to:

create larger tiled maps
support map scrolling

How does it work?
You start instantiating a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really happy to announce that my <a title="J2ME Google Maps API Wiki article" href="http://wiki.forum.nokia.com/index.php/J2ME_Google_Maps_API" target="_blank">J2ME Google Maps API article</a> on <a title="Forum Nokia Wiki" href="http://wiki.forum.nokia.com/" target="_blank">Forum Nokia Wiki</a> has been selected <img src="file:///C:/DOCUME~1/pit/IMPOST~1/Temp/moz-screenshot.jpg" alt="" />as <strong>Article of the Week</strong>! <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://www.jappit.com/images/blog/uploads/j2me_gMapsAPI_article_week3.jpg" alt="J2ME Google Maps API Article of the Week" /></p>
<p>And, to celebrate this event, I&#8217;ve added a brand new feature to my article that will allow you to:</p>
<ul>
<li>create larger <strong>tiled maps</strong></li>
<li>support <strong>map scrolling</strong></li>
</ul>
<h3>How does it work?</h3>
<p>You start instantiating a GoogleMaps object as usual:</p>

<div class="wp_syntax"><div class="code"><pre class="java">GoogleMaps gMap = <span style="color: #000000; font-weight: bold;">new</span> GoogleMaps<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;API_KEY&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Then you get your map, for example geocoding a given address:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #993333;">double</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> coords = gMap.<span style="color: #006600;">geocodeAddress</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Leicester square, London&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #aaaadd; font-weight: bold;">Image</span> mapImage = gMap.<span style="color: #006600;">retrieveStaticImage</span><span style="color: #66cc66;">&#40;</span>
	<span style="color: #cc66cc;">150</span>, <span style="color: #cc66cc;">150</span>,
	coords<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>, coords<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>,
	<span style="color: #cc66cc;">12</span>, <span style="color: #ff0000;">&quot;png&quot;</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Then, let&#8217;s say you want to <strong>scroll your map 100 pixels up</strong>, what you&#8217;ll do is:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #993333;">double</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> newCoords = gMap.<span style="color: #006600;">adjust</span><span style="color: #66cc66;">&#40;</span>
	coords<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>, coords<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>,
	<span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">-100</span>, <span style="color: #cc66cc;">12</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #aaaadd; font-weight: bold;">Image</span> newMapImage = gMap.<span style="color: #006600;">retrieveStaticImage</span><span style="color: #66cc66;">&#40;</span>
	<span style="color: #cc66cc;">150</span>, <span style="color: #cc66cc;">150</span>,
	newCoords<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>, newCoords<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>,
	<span style="color: #cc66cc;">12</span>, <span style="color: #ff0000;">&quot;png&quot;</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>As you&#8217;ve seen, the adjust method takes these arguments:</p>
<ul>
<li>the current <strong>latitude</strong> and <strong>longitude</strong></li>
<li>the <strong>deltaX</strong> and <strong>deltaY</strong>, in pixels</li>
<li>the current <strong>zoom </strong>level</li>
</ul>
<p>and returns the new map center latitude and longitude coordinates.</p>
<p>You can check the full updated source code on Forum Nokia Wiki article: <a title="J2ME Google Maps Wiki article" href="http://wiki.forum.nokia.com/index.php/J2ME_Google_Maps_API" target="_blank">J2ME Google Maps API</a>, and a full-featured example, with the scrolling feature, on the emulator page: <a title="J2ME Google Maps API in action" href="http://www.jappit.com/index.php?page=emulator&amp;midlet=google_maps">J2ME Google Maps API in action</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/09/j2me-google-maps-api-is-article-of-the-week-on-forum-nokia/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ImageFx: J2ME image effects library</title>
		<link>http://www.jappit.com/blog/2008/06/06/imagefx-j2me-image-effects-library/</link>
		<comments>http://www.jappit.com/blog/2008/06/06/imagefx-j2me-image-effects-library/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 13:37:57 +0000</pubDate>
		<dc:creator>pit</dc:creator>
		
		<category><![CDATA[j2me]]></category>

		<category><![CDATA[mobile]]></category>

		<category><![CDATA[animations]]></category>

		<category><![CDATA[effects]]></category>

		<category><![CDATA[image fx]]></category>

		<category><![CDATA[j2me api]]></category>

		<category><![CDATA[j2me library]]></category>

		<category><![CDATA[transitions]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=46</guid>
		<description><![CDATA[After two tutorials on Image animations in J2ME, I&#8217;ve finally decided to put together a library to easily integrate Image effects in a Java ME application. This first release is very very early, and is intended to be tested and to allow developers to give their feedbacks about it, so It&#8217;d be possible to modify [...]]]></description>
			<content:encoded><![CDATA[<p>After <a title="J2ME image sliding transitions" href="http://www.jappit.com/blog/2008/05/22/j2me-image-effects-part-2-sliding-transitions/">two</a> <a title="J2ME image explosion effect" href="http://www.jappit.com/blog/2008/05/20/let-your-images-explode-in-j2me/">tutorials</a> on Image animations in J2ME, I&#8217;ve finally decided to put together a <strong>library to easily integrate Image effects in a Java ME application</strong>. This first release is very very early, and is intended to be tested and to allow developers to give their feedbacks about it, so It&#8217;d be possible to modify and improve it.</p>
<p><img src="http://www.jappit.com/images/blog/uploads/imagefx_banner.gif" alt="ImageFx Banner" width="400" height="149" /></p>
<p>Currently supported effects are visible on the <a title="ImageFx in action" href="http://www.jappit.com/index.php?page=emulator&amp;midlet=image_fx">emulator page</a>, and are:</p>
<ul>
<li><strong>BlindsFx</strong></li>
<li><strong>ExplodeFx</strong></li>
<li><strong>PuzzleFx</strong></li>
<li><strong>ShakeFx</strong></li>
<li><strong>SlideFx</strong></li>
<li><strong>SpiralFx</strong></li>
<li><strong>WaveFx</strong></li>
<li><strong>WipeFx</strong></li>
</ul>
<h3>How to use it?</h3>
<p>Let&#8217;s start from a simple usage example. We start creating an Image, and then using it to create an AnimatedImage instance:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #aaaadd; font-weight: bold;">Image</span> baseImage = <span style="color: #aaaadd; font-weight: bold;">Image</span>.<span style="color: #006600;">createImage</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/base.png&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
AnimatedImage animated = <span style="color: #000000; font-weight: bold;">new</span> AnimatedImage<span style="color: #66cc66;">&#40;</span>baseImage<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Now, we have created an <strong>AnimatedImage</strong>, that is the base class that will allow us to apply effects to <strong>Image</strong>s.</p>
<p>Now, we can create an effect (that will be a subclass of <strong>ImageFx</strong>) and apply it to our AnimatedImage:</p>

<div class="wp_syntax"><div class="code"><pre class="java">ImageFx fx = <span style="color: #000000; font-weight: bold;">new</span> PuzzleFx<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8</span>, <span style="color: #cc66cc;">8</span>, ImageFx.<span style="color: #006600;">TYPE_IN</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
animated.<span style="color: #006600;">setFx</span><span style="color: #66cc66;">&#40;</span>fx<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>In this example, we have chosen a <strong>PuzzleFx </strong>effect, that will show (or hide, depending on Fx type) our image piece by piece. As you can check on <a title="PuzzleFx JavaDocs" href="http://www.jappit.com/j2me/imagefx/doc/com/jappit/imagefx/fxs/PuzzleFx.html" target="_blank">JavaDocs page for PuzzleFx class</a>, first 2 arguments represent the horizontal and vertical pieces to split the Image into, while the last one is the type of the Fx itself.</p>
<p>Now, our AnimatedImage is ready to be animated. To start the animation, simply call the AnimatedImage <strong>start()</strong> method, passing as argument the <strong>effect duration in milliseconds</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="java">animated.<span style="color: #006600;">start</span><span style="color: #66cc66;">&#40;</span>3000L<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>About painting, you&#8217;ll simply have to call the <strong>paint()</strong> method, in a way that is really similar to Graphics drawImage():</p>

<div class="wp_syntax"><div class="code"><pre class="java">animated.<span style="color: #006600;">paint</span><span style="color: #66cc66;">&#40;</span>g, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #aaaadd; font-weight: bold;">Graphics</span>.<span style="color: #006600;">TOP</span> | <span style="color: #aaaadd; font-weight: bold;">Graphics</span>.<span style="color: #006600;">LEFT</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Now, to begin using this library, you don&#8217;t really need any more infos. Just to point out some methods you can find useful in your app:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #808080; font-style: italic;">//stop() method will immediatly stop the FX</span>
fx.<span style="color: #006600;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//isRunning() method tells if the FX is running or not</span>
fx.<span style="color: #006600;">isRunning</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//isEnded() method tells if the FX animation is ended</span>
fx.<span style="color: #006600;">isEnded</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//and, if you want a looping effect, you can use</span>
fx.<span style="color: #006600;">setLooping</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<h3>Further information</h3>
<p>You can library JAR file here: <a title="ImageFx J2ME image effects library" href="http://www.jappit.com/uploads/j2me/ImageFx.jar">ImageFx.jar</a>. Current version requires MIDP 2.0 and CLDC 1.1 to be used (a version compatible with CLDC 1.0 will be released as soon as I&#8217;ve got time :)).</p>
<p>Full API JavaDocs (still in early phase too :)) are also available <a title="ImageFx API JavaDocs" href="http://www.jappit.com/j2me/imagefx/doc/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/06/imagefx-j2me-image-effects-library/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nokia Code Camp Winners, iPhone 3G and Jarpa</title>
		<link>http://www.jappit.com/blog/2008/06/04/nokia-code-camp-winners-iphone-3g-and-jarpa/</link>
		<comments>http://www.jappit.com/blog/2008/06/04/nokia-code-camp-winners-iphone-3g-and-jarpa/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 08:56:58 +0000</pubDate>
		<dc:creator>pit</dc:creator>
		
		<category><![CDATA[cool stuff]]></category>

		<category><![CDATA[flash lite]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[j2me]]></category>

		<category><![CDATA[mobile]]></category>

		<category><![CDATA[nokia]]></category>

		<category><![CDATA[iphone 3g]]></category>

		<category><![CDATA[jarpa]]></category>

		<category><![CDATA[nokia code camp]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=45</guid>
		<description><![CDATA[After a busy period, I finally got some time to come back to Jappit blog, just in time to announce&#8230;
Forum Nokia Code Champ Winners!
This competition, launched by Nokia to promote the development of WebRuntime and Flash-based applications has finally announced his winners, and there are really cool applications!

CityLite of IdeasLite is a guide to night [...]]]></description>
			<content:encoded><![CDATA[<p>After a busy period, I finally got some time to come back to Jappit blog, just in time to announce&#8230;</p>
<h3>Forum Nokia Code Champ Winners!</h3>
<p>This competition, launched by Nokia to promote the development of WebRuntime and Flash-based applications has finally announced his winners, and there are really cool applications!</p>
<p><img src="http://www.jappit.com/images/blog/uploads/citylite.jpg" alt="CityLite" width="450" height="140" /></p>
<p><a title="CityLite website" href="http://www.ideaslite.com/citylite/" target="_blank">CityLite</a> of <a title="IdeasLite website" href="http://www.ideaslite.com/" target="_blank">IdeasLite</a> is a guide to night life in Latin American capitals, with informations about events, theaters, and a lot more. Really cool interface!</p>
<p><img style="vertical-align: top;" src="http://www.jappit.com/images/blog/uploads/kuneri_easyvote.gif" alt="Kuneri EasyVote" width="483" height="116" /></p>
<p><a title="KuneriLite website" href="http://www.kunerilite.net" target="_blank">KuneriLite team</a> also <a title="Kuneri Easy Vote blog post" href="http://bloggy.kuneri.net/2008/06/02/kuneri-easy-vote-is-emea-winner-of-forum-nokia-completition/trackback/" target="_blank">won the award for Europe/Middle East/Africa</a> with their one-button voting system: <a title="Kuneri Easy Vote blog post" href="http://www.kuneri.net/content/view/32/40/" target="_blank">Kuneri Easy Vote</a>! Congratulations for their good work!</p>
<p>For the full list of winners, you can look <a title="Forum Nokia Code Camp Winners" href="http://www.forum.nokia.com/main/contests/global_application_contest.html" target="_blank">here</a>.</p>
<h3>iPhone 3G is finally here!</h3>
<p><img src="http://www.jappit.com/images/blog/uploads/iphone_3g.jpg" alt="Iphone 3g" width="509" height="127" /></p>
<p>After months of guessing and posting, Apple will finally announce, during San Francisco Apple <a title="Apple Worldwide Developers Conference" href="http://developer.apple.com/wwdc/" target="_blank">WorldWide Developers Conference</a> of June 9th, the <a title="Iphone 3g launch date confirmed" href="http://gizmodo.com/391960/iphone-3g-launch-date-confirmed" target="_blank">3G version of its iPhone</a>. And it seems that it&#8217;ll arrive in Italy before the end of June branded by the two Carriers Tim and Vofafone.</p>
<p>While it&#8217;s definitely a good news that it&#8217;ll support HSDPA, it seems that we&#8217;ll not have a builtin GPS&#8230; too bad for all location-fanatics! <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Jarpa, source code is out!</h3>
<p><img src="http://www.jappit.com/images/blog/uploads/jarpa.jpg" alt="Jarpa" width="502" height="99" /></p>
<p><a title="Jarpa website" href="http://www.i2tecnologia.com.br/jarpa/" target="_blank">Jarpa</a> is an absolutely interesting project aiming to extend FlashLite and Java ME feature by allowing them to intercommunicate, and so allowing developers to create hybrid applications that can take the best of both worlds.</p>
<p><a title="Jarpa source code release blog post" href="http://blogs.forum.nokia.com/blog/felipe-andrades-forum-nokia-blog/s60/2008/05/25/connecting-flash-lite-and-java-me" target="_blank">Some days ago</a>, <a title="Felipe Andrade website" href="http://blog.felipeandrade.org/" target="_blank">Felipe Andrade</a> has finally released <a title="Jarpa sourcecode" href="http://code.google.com/p/jarpa/" target="_blank">Jarpa sourcecode</a>, so developers can finally start to benefit of this framework, and for J2ME and FL-addicted like me, this is a GREAT news!</p>
<p>And, if you need one more reason to congratulate with Felipe for its great and extensive work, here is its <a title="Felipe Andrade Forum Nokia Champion" href="http://www.forum.nokia.com/main/forum_nokia_champion/forum_nokia_champions/Felipe_Andrade.html" target="_blank">Nokia Championship award</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/06/04/nokia-code-camp-winners-iphone-3g-and-jarpa/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
