<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating a Blackberry Game &#8211; Part 3</title>
	<atom:link href="http://www.toniwestbrook.com/archives/72/feed" rel="self" type="application/rss+xml" />
	<link>http://www.toniwestbrook.com/archives/72</link>
	<description>Sharing Software Development Knowledge With You</description>
	<lastBuildDate>Tue, 02 Aug 2011 18:55:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Jayachandra</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-91698</link>
		<dc:creator>Jayachandra</dc:creator>
		<pubDate>Mon, 28 Feb 2011 06:23:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-91698</guid>
		<description>Sir 
    Thank u for giving such a valuable information i need images and audio files for this game could u please send them to my mail jayachandra.06ie9@gmail.com</description>
		<content:encoded><![CDATA[<p>Sir<br />
    Thank u for giving such a valuable information i need images and audio files for this game could u please send them to my mail <a href="mailto:jayachandra.06ie9@gmail.com">jayachandra.06ie9@gmail.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adi</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-89743</link>
		<dc:creator>Adi</dc:creator>
		<pubDate>Mon, 22 Nov 2010 10:00:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-89743</guid>
		<description>Toni,

Success!! I put the png files in &#039;src&#039; folder and it works! I&#039;ve also noticed that &#039;png&#039; and &#039;PNG&#039; matters :D

Thanks a lot!</description>
		<content:encoded><![CDATA[<p>Toni,</p>
<p>Success!! I put the png files in &#8216;src&#8217; folder and it works! I&#8217;ve also noticed that &#8216;png&#8217; and &#8216;PNG&#8217; matters <img src='http://www.toniwestbrook.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Thanks a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toni</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-89735</link>
		<dc:creator>Toni</dc:creator>
		<pubDate>Sun, 21 Nov 2010 16:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-89735</guid>
		<description>Hi Adi - thanks for the kind words!  Glad its helped out a bit.  If you take a look at the initBackground method of gfx (GFX class), you&#039;ll see it makes a call to:

Bitmap.getBitmapResource

Anytime you see a getResource kind of method (Bitmaps, InputStreams, etc), it&#039;s going to be looking within your COD file for the resource in question.  To put it into your COD file, you want to add it to your project in Eclipse.  Then when you compile your source, it will add your resource into the final product (COD file).  

You can put path information into any getResource, but the root of the search is the base of the package.  So for instance, my Eclipse project is setup as:

GalacticBlastDemo
--src
----com.synthdreams
------stars.jpg

Which would match a search for &quot;stars.jpg&quot; without any additional path info, akin to how it&#039;s setup in the code above.  Hope that helps - let me know if any of that didn&#039;t make sense</description>
		<content:encoded><![CDATA[<p>Hi Adi &#8211; thanks for the kind words!  Glad its helped out a bit.  If you take a look at the initBackground method of gfx (GFX class), you&#8217;ll see it makes a call to:</p>
<p>Bitmap.getBitmapResource</p>
<p>Anytime you see a getResource kind of method (Bitmaps, InputStreams, etc), it&#8217;s going to be looking within your COD file for the resource in question.  To put it into your COD file, you want to add it to your project in Eclipse.  Then when you compile your source, it will add your resource into the final product (COD file).  </p>
<p>You can put path information into any getResource, but the root of the search is the base of the package.  So for instance, my Eclipse project is setup as:</p>
<p>GalacticBlastDemo<br />
&#8211;src<br />
&#8212;-com.synthdreams<br />
&#8212;&#8212;stars.jpg</p>
<p>Which would match a search for &#8220;stars.jpg&#8221; without any additional path info, akin to how it&#8217;s setup in the code above.  Hope that helps &#8211; let me know if any of that didn&#8217;t make sense</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adi</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-89730</link>
		<dc:creator>Adi</dc:creator>
		<pubDate>Sun, 21 Nov 2010 09:45:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-89730</guid>
		<description>Hi Toni,

It is a very good tutorial and I thank you so much for sharing this with us, especially for people like me who are still in early learning curve in blackberry/JAVA development. 

I&#039;ve come accross this problem where my simulator (i guess) could not recognise the png or jpg file I put from a code like this:

gfx.initBackground(&quot;stars.jpg&quot;, 3);

I am wondering where exactly should we put the png/jpg file in a directory, or should we load it with the IDE (I use Eclipse). Should we also put complete path name in the code above?

Appreciate any help. 

Many thanks,

Adi</description>
		<content:encoded><![CDATA[<p>Hi Toni,</p>
<p>It is a very good tutorial and I thank you so much for sharing this with us, especially for people like me who are still in early learning curve in blackberry/JAVA development. </p>
<p>I&#8217;ve come accross this problem where my simulator (i guess) could not recognise the png or jpg file I put from a code like this:</p>
<p>gfx.initBackground(&#8220;stars.jpg&#8221;, 3);</p>
<p>I am wondering where exactly should we put the png/jpg file in a directory, or should we load it with the IDE (I use Eclipse). Should we also put complete path name in the code above?</p>
<p>Appreciate any help. </p>
<p>Many thanks,</p>
<p>Adi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adi</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-89729</link>
		<dc:creator>Adi</dc:creator>
		<pubDate>Sun, 21 Nov 2010 09:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-89729</guid>
		<description>gfx.initBackground(&quot;stars.jpg&quot;, 3);</description>
		<content:encoded><![CDATA[<p>gfx.initBackground(&#8220;stars.jpg&#8221;, 3);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amit</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-87673</link>
		<dc:creator>amit</dc:creator>
		<pubDate>Tue, 21 Sep 2010 10:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-87673</guid>
		<description>thank u very much for giving us such a helpful tutorial.</description>
		<content:encoded><![CDATA[<p>thank u very much for giving us such a helpful tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ym4me</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-86245</link>
		<dc:creator>ym4me</dc:creator>
		<pubDate>Fri, 27 Aug 2010 10:09:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-86245</guid>
		<description>Thanks you. Very helpful.</description>
		<content:encoded><![CDATA[<p>Thanks you. Very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-76889</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Sun, 21 Feb 2010 04:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-76889</guid>
		<description>Yes, these help greatly.  Thanks for the suggestions, and for posting the tutorial!

-Scott</description>
		<content:encoded><![CDATA[<p>Yes, these help greatly.  Thanks for the suggestions, and for posting the tutorial!</p>
<p>-Scott</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toni</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-76888</link>
		<dc:creator>Toni</dc:creator>
		<pubDate>Sun, 21 Feb 2010 03:55:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-76888</guid>
		<description>Hi Brian - Sorry for the long delayed response, I&#039;ve been away from the blog for too long.  You can use the code above for using the keyboard for everything and leave the trackball out completely.  Using the switch statement on line 237, you can pretty much process any incoming keypress.  So you would move the code from the navigationMovement function to the keychar one.

Scott - usually it should happen the other way around, running very slowly on the emulator but quickly on the actual device.  Slowdowns can happen in a few places - it&#039;s important to look at:

1.  How many threads you&#039;re trying to run simultaneously.  Threads are great for multitasking, but if you try to multitask past the ability of the processor, performance is going to suffer.  You&#039;ll either need to get fancy with when your threads are running, or move things out of threads into serial loops.  

2.  Check all your threads/loops for exactly how much code is being executed.  If you&#039;re trying to do more in a loop than is supported by your framerate, then everything is going to appear sluggish.  The goal is to have processing done before the next frame starts.

3.  Calls to the java mediaplayer take a while to buffer and start playing.  If you notice the slow downs when a sound is being played, you have to do your best to start playing a sound when it won&#039;t interrupt animation.  This is a tricky dance. 

4.  Memory intensive functions - especially in loops (see #2) - make sure you&#039;re not reloading bitmap data every frame, or something like that. This is another juggling act, depending on the Blackberry model you have, you don&#039;t have a ton of memory to play with, so you have to choose between preloading as much as you can to make performance acceptable, but not loading so much that you exhaust your memory (which also causes performance issues).  

Hope those help a bit to get you started.</description>
		<content:encoded><![CDATA[<p>Hi Brian &#8211; Sorry for the long delayed response, I&#8217;ve been away from the blog for too long.  You can use the code above for using the keyboard for everything and leave the trackball out completely.  Using the switch statement on line 237, you can pretty much process any incoming keypress.  So you would move the code from the navigationMovement function to the keychar one.</p>
<p>Scott &#8211; usually it should happen the other way around, running very slowly on the emulator but quickly on the actual device.  Slowdowns can happen in a few places &#8211; it&#8217;s important to look at:</p>
<p>1.  How many threads you&#8217;re trying to run simultaneously.  Threads are great for multitasking, but if you try to multitask past the ability of the processor, performance is going to suffer.  You&#8217;ll either need to get fancy with when your threads are running, or move things out of threads into serial loops.  </p>
<p>2.  Check all your threads/loops for exactly how much code is being executed.  If you&#8217;re trying to do more in a loop than is supported by your framerate, then everything is going to appear sluggish.  The goal is to have processing done before the next frame starts.</p>
<p>3.  Calls to the java mediaplayer take a while to buffer and start playing.  If you notice the slow downs when a sound is being played, you have to do your best to start playing a sound when it won&#8217;t interrupt animation.  This is a tricky dance. </p>
<p>4.  Memory intensive functions &#8211; especially in loops (see #2) &#8211; make sure you&#8217;re not reloading bitmap data every frame, or something like that. This is another juggling act, depending on the Blackberry model you have, you don&#8217;t have a ton of memory to play with, so you have to choose between preloading as much as you can to make performance acceptable, but not loading so much that you exhaust your memory (which also causes performance issues).  </p>
<p>Hope those help a bit to get you started.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Johnson</title>
		<link>http://www.toniwestbrook.com/archives/72#comment-59990</link>
		<dc:creator>Scott Johnson</dc:creator>
		<pubDate>Tue, 01 Sep 2009 01:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.toniwestbrook.com/archives/72#comment-59990</guid>
		<description>Hi Toni:

Great tutorial, I followed it to create my own Spider Solitaire application, since there didn&#039;t seem to be any that I really liked online that I could play without paying a fee.  

One thing I noticed, however, is that the software runs fine in the simulator, but I notice that it&#039;s quite slow when placed on an actual blackberry device.  For example, the trackball movement from one card stack to another seems to lag behind the user by almost a second or more.  I was wondering if you have any advice in efficiency from the simulator to the actual BB device.  

Thanks, 

Scott</description>
		<content:encoded><![CDATA[<p>Hi Toni:</p>
<p>Great tutorial, I followed it to create my own Spider Solitaire application, since there didn&#8217;t seem to be any that I really liked online that I could play without paying a fee.  </p>
<p>One thing I noticed, however, is that the software runs fine in the simulator, but I notice that it&#8217;s quite slow when placed on an actual blackberry device.  For example, the trackball movement from one card stack to another seems to lag behind the user by almost a second or more.  I was wondering if you have any advice in efficiency from the simulator to the actual BB device.  </p>
<p>Thanks, </p>
<p>Scott</p>
]]></content:encoded>
	</item>
</channel>
</rss>

