<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>JaanusSiim</title>
    <link>http://blog.jaanussiim.com/</link>
    
    <description>JaanusSiim</description>
    <language>en-us</language>
    <pubDate>Wed, 22 Feb 2012 22:25:45 +0200</pubDate>
    <lastBuildDate>Wed, 22 Feb 2012 22:25:45 +0200</lastBuildDate>

    
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Jaanussiim" /><feedburner:info uri="jaanussiim" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Jaanussiim</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
      <title>Blast from the past</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/TMOOgPGywEc/blast-from-the-past</link>
      <pubDate>Wed, 22 Feb 2012 00:00:00 +0200</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2012/02/22/blast-from-the-past</guid>
      <description>&lt;p&gt;&lt;strong&gt;Starting J2ME and games&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the end of 2004 Aqris Software AS was looking into different technologies. Something that peaked our interest was J2ME. As I had previously shown interest in game development I was introduced to it. And this is how one man J2ME development team was born :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Balloon pop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As first try we decided to make a Bejeweld clone. I came up with the balloons theme for it. Instead of jewels we would use balloons with new ones floating up from bottom. And this is when fun started.&lt;/p&gt;

&lt;p&gt;Coming to J2ME was a challenge. Wrapping my head around platform fragmentation&amp;#8230; Finding ways how to work around them&amp;#8230; But this was not my only problem. When I was finished then the game consisted of one big run method with gazillion if statements. It was a absolute mess. Who ever wrote that should have been shot in place.&lt;/p&gt;

&lt;p&gt;After working through all these issues the game actually got published at Zed Italy. Aqris had previous contacts with them and this is probably only reason why this deal happened. As I heard nothing from business side, I assume it was a total flop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Duck-Up!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aqris had also other contacts. One of these was Sulake. Creator of &lt;a href='http://www.habbo.com/'&gt;Habbo hotels&lt;/a&gt;. They wanted to have their version of Balloon Pop. For that all the application code went through a massive rewrite. And the result was also internally something beautiful.&lt;/p&gt;

&lt;p&gt;There was a unwritten rule about not using object oriented code in J2ME. Because of classes overhead, size on disk and memory, and limited application JAR sizes this was frowned upon. But after I had seen beautiful code I have never looked back. Always make maintainable code and figure out JAR size limitations later.&lt;/p&gt;

&lt;p&gt;Anyway - Duck-Up! was released in Habbo shops. At some point I did hear a number like 1000 downloads in one month, but I never got it confirmed.&lt;/p&gt;

&lt;p&gt;Application promo from their site:&lt;/p&gt;

&lt;p&gt;&lt;img src='/images/Duck-128.gif' alt='Duck up!' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Puzzle pipes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I guess Duck-Up! had to be some success, because Habbo wanted another game. This time they came with the idea. They wanted to have &amp;#8216;connect pipes&amp;#8217; type of game. Backstory was - new hotel was almost finished, but some plumbing work was still left. And your mission was to finish it before time runs out.&lt;/p&gt;

&lt;p&gt;Basic app architecture from previous project could be used. But there was one challenging part, that I never believed we can do. Animating the fluids running in pipes. On slow J2ME devices we could never have kept the frame rate at acceptable levels. What I ended up doing was craziest fun code ever. Internal pixels of pipe were counted together and as fluids did flow only pixels changing were updated. Somehow this worked perfectly.&lt;/p&gt;

&lt;p&gt;Again, I got no updates about app sales&amp;#8230;&lt;/p&gt;

&lt;p&gt;&lt;img src='/images/Puzzle_Pipes_128x128_v3.gif' alt='Puzzle Pipes' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This was when it clicked&amp;#8230;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thinking back to that time&amp;#8230; Figuring out how to shave few bytes off jar size so that it would fit into 64kB device limit. Finding common base for fragmented devices. Hunting down test devices. This kind of tinkering was real fun. And that is where I got the mobile bug. Although there were a few years between when it was only a hobby. I found my way back to it and am still going strong!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/TMOOgPGywEc" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2012/02/22/blast-from-the-past</feedburner:origLink></item>
    
    <item>
      <title>Starting new project - Wesnoth skirmishes</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/Mxk6xDsZOkc/starting-wesnoth-skirmishes</link>
      <pubDate>Thu, 24 Nov 2011 00:00:00 +0200</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2011/11/24/starting-wesnoth-skirmishes</guid>
      <description>&lt;p&gt;There is a plan. The plan is to push out multiple small projects to improve my portfolio and increase my street cred. Goal of the plan - become freelance and spend some years chilling in Italy. Because this is the place where best things in the world come from - pizza, pasta and Ferrari! During execution of the plan it would be great to do something fun and also learn something new.&lt;/p&gt;

&lt;p&gt;For years I have tought about making my own version of &lt;a href='http://en.wikipedia.org/wiki/Battleship_(game)'&gt;Battleship&lt;/a&gt;. Some years ago I also completed a prototype of it in J2ME. It was called &amp;#8216;Pillow Fight&amp;#8217; and was using some prototype code and characters from &lt;a href='http://en.wikipedia.org/wiki/Habbo'&gt;Habbo hotels&lt;/a&gt;. Unfortunately I never showed it to anyone.&lt;/p&gt;

&lt;p&gt;Now is the perfect time to make this really happen on iPhone. For years I have enjoyed playing &lt;a href='http://wesnoth.org/'&gt;The Battle For Wesnoth&lt;/a&gt; and as it&amp;#8217;s licensed under GPL, resources from it would be ideal for a small fun game. When I mix in learning &lt;a href='http://www.cocos2d-iphone.org/'&gt;Cocos2D&lt;/a&gt; then all the preconditions for fun time and skills increase are met!&lt;/p&gt;

&lt;p&gt;The idea is to start with only a simple Battleship clone, but in time add some more variations and Wesnoth specific features/elements to it. In the future the game could be more then just a simple hit and miss game. It could make use of different landscapes and character skills. Maybe also some story mode could be added&amp;#8230;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/Mxk6xDsZOkc" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2011/11/24/starting-wesnoth-skirmishes</feedburner:origLink></item>
    
    <item>
      <title>iPhone and CellID</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/b0zCxNCGBnQ/iphone-and-cellid</link>
      <pubDate>Wed, 04 May 2011 00:00:00 +0300</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2011/05/04/iphone-and-cellid</guid>
      <description>&lt;p&gt;Since my first contact with &lt;a href='http://en.wikipedia.org/wiki/GIS'&gt;GIS&lt;/a&gt; in general and after finding &lt;a href='http://opencellid.org/'&gt;OpenCellID&lt;/a&gt; database, I have developed an obsession with &lt;a href='http://en.wikipedia.org/wiki/Cell_ID'&gt;CellID&lt;/a&gt;-s. I need to map them. I need to see mapped cell towers on the map. I need to figure out the range of cell towers. And if the tower was 2G only or was also supporting 3G. And of course I needed to create my own GIS server to support all this.&lt;/p&gt;

&lt;p&gt;In the old days You could access mobile towers cell id on almost any feature phone. With J2ME on SonyEricsson and  Nokia phones it was a cake walk. With Android everything got even better. Loved my HTC Hero (European version with the chin). But since my day job consists mainly of iOS development, I have also moved to iPhone 4. And the problem is - there is no way to access CellID data programmatically on iOS. You can access MNC and MCC, but no CellID.&lt;/p&gt;

&lt;p&gt;As a developer this little detail can&amp;#8217;t stop me from writing a map application with CellID mapping support. I still have the old Hero laying around and with the iOS 4.3 update I got the most brilliant idea - would it not be possible to connect Hero to iPhone&amp;#8217;s WiFi hotspot and access needed data somehow this way?&lt;/p&gt;

&lt;p&gt;Initial tests have  been positive. Using &lt;a href='http://code.google.com/p/i-jetty/'&gt;i-jetty&lt;/a&gt; on Android I was able to access the device from iPhone providing WiFi connection. Now I just need to check if I can also access required device data from Jetty servlets. If everything works out, I could connect multiple Android devices simultaneously and map all towers for operators in Estonia at the same time.&lt;/p&gt;

&lt;p&gt;What will I do with the data? Probably just some pretty graphics  and nothing more. It&amp;#8217;s more about the journey&amp;#8230;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/b0zCxNCGBnQ" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2011/05/04/iphone-and-cellid</feedburner:origLink></item>
    
    <item>
      <title>Eclipse with preprocessing</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/1bKeRSvOPQw/eclipse-with-preprocessing</link>
      <pubDate>Sun, 07 Sep 2008 00:00:00 +0300</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2008/09/07/eclipse-with-preprocessing</guid>
      <description>&lt;p&gt;When working with code that was written by somebody else, one of the most annoying issues for me was inconsistent code formating. Actually in this particular case the indentation was totally screwed up.&lt;/p&gt;

&lt;p&gt;Only option was automatic formatting with Eclipse. But there was a problem with preprocessing directives in code. They all got screwed up, a space was added between // and #, and nothing worked. To my luck (and for the luck of other J2ME developers :P) there is a setting &amp;#8216;Enable line comment formatting&amp;#8217; buried inside code formating settings. With this option disabled, preprocessing worked as a charm.&lt;/p&gt;

&lt;p&gt;This particular code was also using code preprocessing in imports, that got still screwed up. But this should be considered a bad style anyway. And it is really not needed. You should preprocess code/class usage and let obfuscation do rest of the work – removing unneeded imports/classes.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/1bKeRSvOPQw" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2008/09/07/eclipse-with-preprocessing</feedburner:origLink></item>
    
    <item>
      <title>J2MEDB version 0.2.0 has been released</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/KoGV4BHpE-g/j2medb-version-020-has-been-released</link>
      <pubDate>Sun, 02 Mar 2008 00:00:00 +0200</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2008/03/02/j2medb-version-020-has-been-released</guid>
      <description>&lt;p&gt;Updated version of J2MEDB has been launched on &lt;a href='http://www.j2mehandsets.com'&gt;j2mehandsets.com&lt;/a&gt;. Main work has gone into usability and handset detection improvement.&lt;/p&gt;

&lt;p&gt;On MIDlet side key mappings test was altered a bit. I hope that new graphics will make the test more understandable. Also it has been made clearer, that on every upload only data for current test will be uploaded. I was thinking about uploading all test data in one go, but because of media test crash on Nokia 7650 I decided to drop it.&lt;/p&gt;

&lt;p&gt;On server side handsets approving and some minor data editing options have been added. Handsets listing by supported APIs has also been enabled. I tried to improve handset detection based on current data available, but probably more issues can come up in that area.&lt;/p&gt;

&lt;p&gt;At the moment the database only contains Nokia and SonyEricsson phones, which is bad :) But I am working on plan for adding more handsets (also from different manufacturers) to database.&lt;/p&gt;

&lt;p&gt;For next version I would like to add some simple wiki implementation for known issues and general test descriptions.&lt;/p&gt;

&lt;p&gt;So, please, keep testing :P&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/KoGV4BHpE-g" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2008/03/02/j2medb-version-020-has-been-released</feedburner:origLink></item>
    
    <item>
      <title>J2MEDB - version 0.1.0</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/CtyNS8CFZWE/j2medb-version-010</link>
      <pubDate>Tue, 22 Jan 2008 00:00:00 +0200</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2008/01/22/j2medb-version-010</guid>
      <description>&lt;p&gt;After playing with the idea really long time, initial version of &lt;a href='http://www.jaanussiim.com/redmine/projects/show/3'&gt;J2MEDB&lt;/a&gt; is up and running on &lt;a href='http://www.j2mehandsets.com/'&gt;www.J2MEHandsets.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Idea&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The idea for my own database came from dissatisfaction with other databases available at that time. There were databases, that had a lot of useful data, but were a bit too generic. For example they listed all available sound formats, but did not mention, which protocols supported these. There were also databases, that were just filled from official specs, even if Java implementation did not support it.&lt;/p&gt;

&lt;p&gt;At some point I would like to add database support to &lt;a href='http://www.jaanussiim.com/redmine/projects/show/1'&gt;midlet-builder&lt;/a&gt;. In theory it should be possible to just tell midlet-builder to generate build for all handsets contained in database. And if &lt;a href='http://www.jaanussiim.com/redmine/projects/show/2'&gt;midlet-engine&lt;/a&gt; implementation is also mature enough, it could really happen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Current implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In current implementation I have mostly focused on data upload and simple data display. I feel, that I could have made it a bit better, but wanned to have some initial feedback. And also see, what kind of data could I expect. And where might the bottlenecks be.&lt;/p&gt;

&lt;p&gt;At the moment SonyEricsson and Nokia support should be decent, but I did not have any other devices available during development – so, you may never know&amp;#8230;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Future plans&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make it more prettier :)&lt;/li&gt;

&lt;li&gt;Add some kind of simple screening support. At the moment all devices will be added in &amp;#8216;pending for approval&amp;#8217; status.&lt;/li&gt;

&lt;li&gt;Improve handset detection on midlet/server&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/CtyNS8CFZWE" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2008/01/22/j2medb-version-010</feedburner:origLink></item>
    
    <item>
      <title>MIDlet localization done right</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/cqX9BO_XCnU/midlet-localization-done-right</link>
      <pubDate>Mon, 05 Nov 2007 00:00:00 +0200</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2007/11/05/midlet-localization-done-right</guid>
      <description>&lt;p&gt;I have used two ways for MIDlet localization since I started coding J2ME. I will be describing my changes in localization handling based on demand from clients.&lt;/p&gt;

&lt;p&gt;Actually I have used three solutions. The first solution was having all your strings hard coded in source files and never change them. It worked until we found a client in Italy and we needed to support two languages.&lt;/p&gt;

&lt;p&gt;Then we opted on using the tools that we knew at the time. We used &lt;a href='http://ant.apache.org/manual/CoreTasks/replace.html'&gt;ant&amp;#8217;s replace task&lt;/a&gt; for processing translation strings. It worked really well at that time. Of course we had to create two builds for every targeted phones group, but we could handle it. What made things a bit difficult was that the build system we used then produced some times broken builds. So the release schedule also included me running every build in emulator. Just in case. If some code path did not work we made a new build for that device and everything was fixed.&lt;/p&gt;

&lt;p&gt;Then we got a client, that wished to support twelve languages. It was clear, that our procedure at that time did not work anymore. I think that the idea for current implementation (used also in midlet-builder/midlet-engine) came from J2ME-Polish. It was how they were handling localization (disclaimer - I can&amp;#8217;t remember, if I have ever actually looked at localization code in J2ME-Polish), or at least how I understood it.&lt;/p&gt;

&lt;p&gt;In first step of localization midlet-builder will generate two files from input directory. The actual localization file and a file used by preprocessor later on. The localization file generated has following format:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='java'&gt;&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;number&lt;/span&gt; &lt;span class='n'&gt;of&lt;/span&gt; &lt;span class='n'&gt;languages&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='n'&gt;at&lt;/span&gt; &lt;span class='n'&gt;the&lt;/span&gt; &lt;span class='n'&gt;moment&lt;/span&gt; &lt;span class='k'&gt;this&lt;/span&gt; &lt;span class='n'&gt;is&lt;/span&gt; &lt;span class='kt'&gt;byte&lt;/span&gt;
&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;number&lt;/span&gt; &lt;span class='n'&gt;of&lt;/span&gt; &lt;span class='n'&gt;translation&lt;/span&gt; &lt;span class='n'&gt;keys&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='n'&gt;number&lt;/span&gt; &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='n'&gt;different&lt;/span&gt; &lt;span class='n'&gt;strings&lt;/span&gt; &lt;span class='n'&gt;used&lt;/span&gt;
    &lt;span class='n'&gt;in&lt;/span&gt; &lt;span class='n'&gt;MIDlet&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='n'&gt;This&lt;/span&gt; &lt;span class='n'&gt;number&lt;/span&gt; &lt;span class='n'&gt;does&lt;/span&gt; &lt;span class='n'&gt;not&lt;/span&gt; &lt;span class='n'&gt;include&lt;/span&gt; &lt;span class='n'&gt;some&lt;/span&gt; &lt;span class='n'&gt;special&lt;/span&gt; &lt;span class='n'&gt;keys&lt;/span&gt;
    &lt;span class='n'&gt;described&lt;/span&gt; &lt;span class='n'&gt;later&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Next we will have stings used on localization screen for language selection by user&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='java'&gt;&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt; &lt;span class='n'&gt;codes&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='n'&gt;two&lt;/span&gt; &lt;span class='n'&gt;character&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt; &lt;span class='n'&gt;codes&lt;/span&gt; &lt;span class='n'&gt;that&lt;/span&gt; &lt;span class='n'&gt;can&lt;/span&gt; &lt;span class='n'&gt;be&lt;/span&gt; &lt;span class='n'&gt;used&lt;/span&gt; &lt;span class='k'&gt;for&lt;/span&gt;
    &lt;span class='n'&gt;automatic&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt; &lt;span class='n'&gt;selection&lt;/span&gt; &lt;span class='n'&gt;on&lt;/span&gt; &lt;span class='n'&gt;the&lt;/span&gt; &lt;span class='nf'&gt;phone&lt;/span&gt; &lt;span class='o'&gt;(&lt;/span&gt;&lt;span class='n'&gt;comparing&lt;/span&gt; &lt;span class='n'&gt;it&lt;/span&gt; &lt;span class='n'&gt;to&lt;/span&gt;
    &lt;span class='n'&gt;microedition&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;locale&lt;/span&gt; &lt;span class='n'&gt;property&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='n'&gt;A&lt;/span&gt; &lt;span class='n'&gt;note&lt;/span&gt; &lt;span class='err'&gt;–&lt;/span&gt; &lt;span class='k'&gt;this&lt;/span&gt; &lt;span class='n'&gt;will&lt;/span&gt; &lt;span class='n'&gt;not&lt;/span&gt; &lt;span class='n'&gt;work&lt;/span&gt; &lt;span class='n'&gt;on&lt;/span&gt;
    &lt;span class='n'&gt;some&lt;/span&gt; &lt;span class='n'&gt;Samsung&lt;/span&gt; &lt;span class='n'&gt;phones&lt;/span&gt;&lt;span class='o'&gt;).&lt;/span&gt;
&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt; &lt;span class='n'&gt;names&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='n'&gt;localized&lt;/span&gt; &lt;span class='n'&gt;languages&lt;/span&gt; &lt;span class='n'&gt;names&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='n'&gt;Preferably&lt;/span&gt; &lt;span class='n'&gt;in&lt;/span&gt; &lt;span class='kd'&gt;native&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;
&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;special&lt;/span&gt; &lt;span class='n'&gt;select&lt;/span&gt; &lt;span class='n'&gt;keys&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='n'&gt;also&lt;/span&gt; &lt;span class='n'&gt;used&lt;/span&gt; &lt;span class='n'&gt;on&lt;/span&gt; &lt;span class='n'&gt;localization&lt;/span&gt; &lt;span class='n'&gt;key&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='n'&gt;If&lt;/span&gt; &lt;span class='n'&gt;you&lt;/span&gt;
    &lt;span class='n'&gt;were&lt;/span&gt; &lt;span class='n'&gt;moving&lt;/span&gt; &lt;span class='n'&gt;up&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='n'&gt;down&lt;/span&gt; &lt;span class='n'&gt;in&lt;/span&gt; &lt;span class='n'&gt;languages&lt;/span&gt; &lt;span class='n'&gt;list&lt;/span&gt;&lt;span class='o'&gt;,&lt;/span&gt; &lt;span class='err'&gt;&amp;#39;&lt;/span&gt;&lt;span class='n'&gt;select&lt;/span&gt;&lt;span class='err'&gt;&amp;#39;&lt;/span&gt; &lt;span class='n'&gt;string&lt;/span&gt; &lt;span class='n'&gt;will&lt;/span&gt;
    &lt;span class='n'&gt;be&lt;/span&gt; &lt;span class='n'&gt;shown&lt;/span&gt; &lt;span class='n'&gt;in&lt;/span&gt; &lt;span class='n'&gt;highlighted&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;
&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;help&lt;/span&gt; &lt;span class='n'&gt;strings&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt;
&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;about&lt;/span&gt; &lt;span class='n'&gt;strings&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt;
&lt;span class='o'&gt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;all&lt;/span&gt; &lt;span class='n'&gt;keys&lt;/span&gt; &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;every&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='n'&gt;This&lt;/span&gt; &lt;span class='n'&gt;is&lt;/span&gt; &lt;span class='n'&gt;where&lt;/span&gt; &lt;span class='n'&gt;all&lt;/span&gt; &lt;span class='n'&gt;translation&lt;/span&gt;
    &lt;span class='n'&gt;strings&lt;/span&gt; &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;every&lt;/span&gt; &lt;span class='n'&gt;language&lt;/span&gt; &lt;span class='n'&gt;are&lt;/span&gt; &lt;span class='n'&gt;entered&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='n'&gt;All&lt;/span&gt; &lt;span class='n'&gt;the&lt;/span&gt; &lt;span class='n'&gt;keys&lt;/span&gt; &lt;span class='n'&gt;will&lt;/span&gt; &lt;span class='n'&gt;be&lt;/span&gt;
    &lt;span class='n'&gt;same&lt;/span&gt; &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;every&lt;/span&gt; &lt;span class='n'&gt;localization&lt;/span&gt; &lt;span class='n'&gt;set&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt; &lt;span class='n'&gt;And&lt;/span&gt; &lt;span class='n'&gt;they&lt;/span&gt; &lt;span class='n'&gt;will&lt;/span&gt; &lt;span class='n'&gt;be&lt;/span&gt; &lt;span class='n'&gt;entered&lt;/span&gt; &lt;span class='n'&gt;in&lt;/span&gt;
    &lt;span class='n'&gt;the&lt;/span&gt; &lt;span class='n'&gt;same&lt;/span&gt; &lt;span class='n'&gt;order&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The other file generated is used in source files preprocessing. We&amp;#8217;ll call it &amp;#8216;key_map.txt&amp;#8217;. It has key-number pairs for key index in localization set. For example &amp;#8216;menu.help = 0&amp;#8217; would mean that translation for &amp;#8216;HELP&amp;#8217; string in main menu is located in first position for every language.&lt;/p&gt;

&lt;p&gt;In the source code we have languages screen for language selection. It will load language codes, language names and select strings for displaying these on the screen&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='java'&gt;    &lt;span class='n'&gt;InputStream&lt;/span&gt; &lt;span class='n'&gt;is&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;getClass&lt;/span&gt;&lt;span class='o'&gt;().&lt;/span&gt;&lt;span class='na'&gt;getResourceAsStream&lt;/span&gt;&lt;span class='o'&gt;(&lt;/span&gt;&lt;span class='s'&gt;&amp;quot;/loc.bin&amp;quot;&lt;/span&gt;&lt;span class='o'&gt;);&lt;/span&gt;
    &lt;span class='n'&gt;DataInputStream&lt;/span&gt; &lt;span class='n'&gt;dis&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='n'&gt;DataInputStream&lt;/span&gt;&lt;span class='o'&gt;(&lt;/span&gt;&lt;span class='n'&gt;is&lt;/span&gt;&lt;span class='o'&gt;);&lt;/span&gt;
    &lt;span class='kd'&gt;final&lt;/span&gt; &lt;span class='kt'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;languages&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='n'&gt;dis&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;readByte&lt;/span&gt;&lt;span class='o'&gt;();&lt;/span&gt;
    &lt;span class='n'&gt;languageNames&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='n'&gt;String&lt;/span&gt;&lt;span class='o'&gt;[&lt;/span&gt;&lt;span class='n'&gt;languages&lt;/span&gt;&lt;span class='o'&gt;];&lt;/span&gt;
    &lt;span class='n'&gt;languageCodes&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='n'&gt;String&lt;/span&gt;&lt;span class='o'&gt;[&lt;/span&gt;&lt;span class='n'&gt;languages&lt;/span&gt;&lt;span class='o'&gt;];&lt;/span&gt;
    &lt;span class='n'&gt;selectStrings&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='k'&gt;new&lt;/span&gt; &lt;span class='n'&gt;String&lt;/span&gt;&lt;span class='o'&gt;[&lt;/span&gt;&lt;span class='n'&gt;languages&lt;/span&gt;&lt;span class='o'&gt;];&lt;/span&gt;

    &lt;span class='c1'&gt;//ignore translations length&lt;/span&gt;
    &lt;span class='n'&gt;dis&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;readByte&lt;/span&gt;&lt;span class='o'&gt;();&lt;/span&gt;
    &lt;span class='k'&gt;for&lt;/span&gt;&lt;span class='o'&gt;(&lt;/span&gt;&lt;span class='kt'&gt;int&lt;/span&gt; &lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&lt;/span&gt;&lt;span class='n'&gt;lt&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt; &lt;span class='n'&gt;languageCodes&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;length&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;++){&lt;/span&gt;
      &lt;span class='n'&gt;languageCodes&lt;/span&gt;&lt;span class='o'&gt;[&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;]=&lt;/span&gt;&lt;span class='n'&gt;dis&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;readUTF&lt;/span&gt;&lt;span class='o'&gt;();&lt;/span&gt;
    &lt;span class='o'&gt;}&lt;/span&gt;

    &lt;span class='k'&gt;for&lt;/span&gt;&lt;span class='o'&gt;(&lt;/span&gt;&lt;span class='kt'&gt;int&lt;/span&gt; &lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&lt;/span&gt;&lt;span class='n'&gt;lt&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt; &lt;span class='n'&gt;languageNames&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;length&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;++){&lt;/span&gt;
      &lt;span class='n'&gt;languageNames&lt;/span&gt;&lt;span class='o'&gt;[&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;]=&lt;/span&gt;&lt;span class='n'&gt;dis&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;readUTF&lt;/span&gt;&lt;span class='o'&gt;();&lt;/span&gt;
    &lt;span class='o'&gt;}&lt;/span&gt;

    &lt;span class='k'&gt;for&lt;/span&gt;&lt;span class='o'&gt;(&lt;/span&gt;&lt;span class='kt'&gt;int&lt;/span&gt; &lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&lt;/span&gt;&lt;span class='n'&gt;lt&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt; &lt;span class='n'&gt;selectStrings&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;length&lt;/span&gt;&lt;span class='o'&gt;;&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;++){&lt;/span&gt;
      &lt;span class='n'&gt;selectStrings&lt;/span&gt;&lt;span class='o'&gt;[&lt;/span&gt;&lt;span class='n'&gt;i&lt;/span&gt;&lt;span class='o'&gt;]=&lt;/span&gt;&lt;span class='n'&gt;dis&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='na'&gt;readUTF&lt;/span&gt;&lt;span class='o'&gt;();&lt;/span&gt;
    &lt;span class='o'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Here the translation keys length is ignored, because it has no meaning here. Maybe it should be moved to different position.&lt;/p&gt;

&lt;p&gt;Because all languages are shown in the order, as they are in localization file, we can search for used language keys start position, after user has selected one. Until now no actual translations have been loaded. To load the keys into array we skip all special keys and also all different language keys that can come before selected language.&lt;/p&gt;

&lt;p&gt;For accessing localization keys from code we have two methods in translation handler: get(String keyName) and get(int keyIndex). The first method will have no implementation and is there only for compiler and will be replaced by translation preprocessor. The preprocessor will replace all get(“key.name”) calls with get(index) calls based on values loaded from &amp;#8216;key_map.txt&amp;#8217;.&lt;/p&gt;

&lt;p&gt;Because help and about text are usually not displayed that often and take more space in memory, they are handled a bit differently. They are loaded &amp;#8216;on demand&amp;#8217; and are not kept in memory (unlike other strings for loaded language).&lt;/p&gt;

&lt;p&gt;So this is my opinion of &amp;#8216;localization done right&amp;#8217;. I should really create a wiki page describing the process and all included file formats.&lt;/p&gt;

&lt;p&gt;In the future I would also like to add localization loading from server and maybe just keep actually used translations in memory (for example only main menu elements). But this would require an automated way for detecting keys used on every screen&amp;#8230; Looks like an idea for future projects!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/cqX9BO_XCnU" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2007/11/05/midlet-localization-done-right</feedburner:origLink></item>
    
    <item>
      <title>How I made a backup from public wiki</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/LQ5G4KfPN7E/how-i-made-a-backup-from-a-public-wiki</link>
      <pubDate>Mon, 29 Oct 2007 00:00:00 +0200</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2007/10/29/how-i-made-a-backup-from-a-public-wiki</guid>
      <description>&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lately the &lt;a href='http://www.j2meforums.com/wiki/index.php/Main_Page'&gt;J2ME forums wiki&lt;/a&gt; has been under constant spam attacks. As the owner of the forum seems to be rather busy, to implement some spam protection, there was an idea to create a backup from the data in wiki before spam. I have no access to the wiki server, so I had to use other means available. &lt;a href='http://code.whytheluckystiff.net/hpricot/'&gt;Hpricot&lt;/a&gt; to rescue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Know the enemy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To me it looked like there is no way to be sure, if site contains spam or not. Some users experimented with adding spam links into hidden div in hopes that spam robot will be fooled. But it had no effects. So we may have spam links on all pages. There was also no 100% sure way to know, when spam posts started, so I opted for full backup of the wiki.&lt;/p&gt;

&lt;p&gt;So I needed a history for all discovered pages. In &lt;a href='http://www.mediawiki.org/wiki/MediaWiki'&gt;MediaWiki&lt;/a&gt; the pages history is available using address:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='html'&gt;index.php?title=#{page_name}&lt;span class='ni'&gt;&amp;amp;amp;&lt;/span&gt;action=history
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As I had no idea how many pages there were in history I had to add parameters&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='ni'&gt;&amp;amp;amp;&lt;/span&gt;limit=1000&lt;span class='ni'&gt;&amp;amp;amp;&lt;/span&gt;offset=0
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;to the url. As default I would have gotten&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='html'&gt;limit=50
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;From history page I searched links for every available revision for the page. Armed with this knowledge I could scan every revision of the page, search for additional internal links, and save page content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Can be downloaded from &lt;a href='http://jaanussiim-blog.s3.amazonaws.com/wiki.zip'&gt;s3 bucket&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I created a Parser object, that will be initialized with the wiki url. After that You just call the&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='ruby'&gt;&lt;span class='n'&gt;parse&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;entry_page&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;method and it will start making backups of the wiki pages. Saving these into &amp;#8216;data&amp;#8217; directory. All saved pages will have modification date in their name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After 10 hours of running and 3GB data transferred I had 850 MB of knowledge in &amp;#8216;data&amp;#8217; directory. Probably a lot of it is also spam. The next step should be converting these pages automatically to &lt;a href='http://wiki.splitbrain.org/wiki:dokuwiki'&gt;DocuWiki&lt;/a&gt; format and removing spam. At the moment I will probably create clean pages by hand and look at it later.&lt;/p&gt;

&lt;p&gt;I also tried to use urls blacklist from &lt;a href='http://blacklist.chongqed.org/'&gt;blacklist.chongqed.org&lt;/a&gt; but in my experiments it turned out to be rather useless. The latest urls were not listed there&amp;#8230; In the end it actually did not make any difference. I just made a dump of data on the page.&lt;/p&gt;

&lt;p&gt;Was it worth it - for me definitely. I added my url as user agent in request and until now nobody from J2ME forums has also complained.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lessons learned&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hpricot made the task a lot easier. I must admit, that I had some small problems with it at first&amp;#8230; But it got better.&lt;/p&gt;

&lt;p&gt;In the parser, there is also one redundant step. There is no point for getting internal links from actual history page. This data is also available on edit page, that will be visited anyways&amp;#8230; If this step would be removed, then the parser could have completed the backup in 50% less time transferring 50% less data. Too bad I realized that next morning, when script was already running.&lt;/p&gt;

&lt;p&gt;And the revelation today - I need to start commenting my code better. You never know, when it will get published.&lt;/p&gt;

&lt;p&gt;Anyway - have fun! Now I&amp;#8217;m going back to mobile development.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/LQ5G4KfPN7E" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2007/10/29/how-i-made-a-backup-from-a-public-wiki</feedburner:origLink></item>
    
    <item>
      <title>A library repository for midlet-builder</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/eXCllayPIag/a-library-repository-for-midlet-builder</link>
      <pubDate>Wed, 17 Oct 2007 00:00:00 +0300</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2007/10/17/a-library-repository-for-midlet-builder</guid>
      <description>&lt;p&gt;One feature for &lt;a href='http://www.jaanussiim.com/redmine/projects/show/1'&gt;midlet-builder&lt;/a&gt; would be dynamic jars selection for source compilation. The selection would be handled based on supported device properties. This should, in theory, add additional security level, that the compiled code is also suitable for the device. You could immediately see, if you are using classes from unsupported packages.&lt;/p&gt;

&lt;p&gt;First of all I need a cheap location for the repository. And at the moment &lt;a href='http://www.amazon.com/S3-AWS-home-page-Money/b/ref=sc_fe_l_2/103-8634166-2789454?ie=UTF8&amp;amp;node=16427261&amp;amp;no=342430011&amp;amp;me=A36L942TSJ2AJA'&gt;Amazon&amp;#8217;s S3&lt;/a&gt; looks like a perfect solution. It is lacking possibility for browsing, but I&amp;#8217;m sure there are ways around it.&lt;/p&gt;

&lt;p&gt;After playing a bit with S3 I have one tip for you - go straight to &lt;a href='http://s3sync.net/wiki'&gt;s3sync&lt;/a&gt;. In my opinion the fastest way to test S3. I started experimenting with Ruby code. And it was really not going anywhere&amp;#8230; But it was my problem - some times I just can&amp;#8217;t stand, if something is holding me back from working on my ideas.&lt;/p&gt;

&lt;p&gt;Anyhow - the tough part will be dependency handling. At the moment I&amp;#8217;m leaning towards using &lt;a href='http://ant.apache.org/ivy/'&gt;Ivy&lt;/a&gt; for it. It could be used as standalone from command line. What I do not like about it is, that it will create additional dependency inside midlet-builder. Already I&amp;#8217;m relying on too many external programs, that can&amp;#8217;t be configured.&lt;/p&gt;

&lt;p&gt;As another solution I should check dependency handling in &lt;a href='http://raven.rubyforge.org/'&gt;Raven&lt;/a&gt;. If I only found some time for it&amp;#8230;&lt;/p&gt;

&lt;p&gt;And of course midlet-bulder could also handle the dependency resolving. As I figure - it does not have to me something fancy&amp;#8230; Just some dirty version comparing and http requests&amp;#8230; But at the moment it should be really low priority&amp;#8230; I have more important issues to resolve.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/eXCllayPIag" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2007/10/17/a-library-repository-for-midlet-builder</feedburner:origLink></item>
    
    <item>
      <title>Midlet-engine - J2ME on Rails?</title>
      <link>http://feedproxy.google.com/~r/Jaanussiim/~3/4JpPXbs1prg/midlet-engine-j2me-on-rails</link>
      <pubDate>Thu, 11 Oct 2007 00:00:00 +0300</pubDate>
      <author>jaanus@jaanussiim.com (Jaanus Siim)</author>
      <guid isPermaLink="false">http://blog.jaanussiim.com/2007/10/11/midlet-engine-j2me-on-rails</guid>
      <description>&lt;p&gt;Ok, ok - the title is a bit bold. But the idea behind the framework for J2ME games should be the same - to handle all common behavior and let You just create.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://www.jaanussiim.com/redmine/projects/show/2'&gt;midlet-engine&lt;/a&gt; is based on the idea that only places, where games code will change, are in main menu animation and game logic/rendering. Everything else can be handled by common code and can be reused. There is no need for creating screens flow handling, localization, resources loading, etc. from scratch for every new game. Just create a common framework for implementation, that would be reused, and innovate. The additional benefit of a framework would be, that it would contain all the knowledge about device specific bugs and workarounds for these.&lt;/p&gt;

&lt;p&gt;Currently midlet-engine handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;localization&lt;/li&gt;

&lt;li&gt;screens flow (from intro screen to outro screen)&lt;/li&gt;

&lt;li&gt;custom font implementation&lt;/li&gt;

&lt;li&gt;a custom sprite implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Should handle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;network communication&lt;/li&gt;

&lt;li&gt;generic high scores handling&lt;/li&gt;

&lt;li&gt;generic saved game handling&lt;/li&gt;

&lt;li&gt;handling and separation for thread driven and event driven MIDlets&lt;/li&gt;

&lt;li&gt;resource packages for screen/level&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The problem with the midlet-engine at the moment is, that it&amp;#8217;s not really flexible. To use it for event driven MIDlet I had to use some hacks in midlet-builder, to ignore not needed classes. This should be some how configured and handled better.&lt;/p&gt;

&lt;p&gt;Under resource packages I was thinking that there should be a way to determine automatically, what resources are needed by every step of the application. Basically between load screens. If it could be detected, then we could combine these resources in different resource packages, to gain some jar space. But at the same time the resource packages wold not get too big and make loading noticeably slower&amp;#8230;&lt;/p&gt;

&lt;p&gt;But the method for detecting the used resources is basis for another project&amp;#8230;&lt;/p&gt;

&lt;p&gt;So many ideas and so little time&amp;#8230;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Jaanussiim/~4/4JpPXbs1prg" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://blog.jaanussiim.com/2007/10/11/midlet-engine-j2me-on-rails</feedburner:origLink></item>
    

  </channel> 
</rss>

