BlackBerryForums.com : Your Number One BlackBerry Community   TaskMaster for BlackBerry   

»Sponsored Links



Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
pwaugh Offline
Knows Where the Search Button Is
 
Posts: 40
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: at&t
Question Eclipse and bitmap resources - 07-22-2008, 11:35 PM

New to Eclipse, using Ganymede.

Have it all setup with a nice Ant build script, and everything seems fine but when I run the program (which worked fine under the BB JDE), it runs into a Null Pointer exception because it can't find the bitmap resources.

My directory structure is this:

Code:
workspace
+
+--com_crackberry_launcher
     +
     +--bin
     +--dist
     +--src
         +
         +--com
              +
              +--crackberry
                   +
                   +--img   (.png files here)
and the relevent code is:

Code:
    public static void setColor(String color) {
        icon1 = Bitmap.getBitmapResource(color + "A.png");
        icon2 = Bitmap.getBitmapResource(color + "B.png");
        HomeScreen.updateIcon(icon1, 1);
        HomeScreen.setRolloverIcon(icon2, 1);
    }
and part of the build.xml:

Code:
	<target name="Build" description="builds application" depends="-Init">
		<rapc output="${output}" destdir="${dist}" jdehome="${jdehome}" jdkhome="${javahome}">
			<jdp type="cldc" 
				title="${title}" vendor="${vendor}" 
				version="${version}" 
				description="${description}" 
				systemmodule="true" 
				runonstartup="true" 
				startuptier="7" >
				<entry 
					title="${title}" 
					arguments="click" 
					systemmodule="false" 
					runonstartup="false" 
					startuptier="7" 
					ribbonposition="0" 
					icon="OrangeA.png" />
			</jdp>
			<src>
				<fileset dir="${src}">
					<include name="**/*.java" />
					<include name="*.png" />
					<include name="resources/**/*.*" />
				</fileset>
			</src>
		</rapc>
		<copy todir="${simulator}" verbose="false">
			<fileset dir="${dist}">
				<include name="*.cod" />
				<include name="*.debug" />
				<include name="*.cso" />
			</fileset>
		</copy>
		<echo message="Build ${build.number} complete." />
	</target>
What am I doing wrong?

Also, when I right click and build, using Ant, I have to manually start the simulator by clicking "Launch Simulator" on the sim server. Is there a way to have it auto-launch?

Thanks
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
VegetableBird Offline
New Member
 
Posts: 9
Join Date: Jul 2008
Model: 8100
PIN: N/A
Carrier: 8-)
Default 07-22-2008, 11:49 PM

try <include name="**/*.png" /> or <include name="com/crackberry/*.png" />
   
Reply With Quote
  (#3 (permalink)) Old
pwaugh Offline
Knows Where the Search Button Is
 
Posts: 40
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: at&t
Default 07-23-2008, 12:15 AM

Thanks, that did the trick!
   
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




TaskMaster for BlackBerry


Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1