BlackBerry Forums Support Community
              

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

Please Login to Remove!

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
Offline  
Old 07-22-2008, 11:49 PM   #2
VegetableBird
New Member
 
Join Date: Jul 2008
Model: 8100
PIN: N/A
Carrier: 8-)
Posts: 9
Default

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

Thanks, that did the trick!
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Original New DEC Digital DCJ11-AE 57-19400-09 Vintage CPU x 1pc picture

Original New DEC Digital DCJ11-AE 57-19400-09 Vintage CPU x 1pc

$100.00



Vintage Printing Letterpress Printers Block Months Of The Year Jan-Dec picture

Vintage Printing Letterpress Printers Block Months Of The Year Jan-Dec

$18.00



Vintage Christmas Tree December Daily - Junk Journal - Diary - Christmas Planner picture

Vintage Christmas Tree December Daily - Junk Journal - Diary - Christmas Planner

$18.00



DEC DIGITAL VINTAGE RA8X Control Panel picture

DEC DIGITAL VINTAGE RA8X Control Panel

$30.00



Dec/Adac Corp. D4-10390 Rev 6 Model 1664ATTL Output Pulse Board 1983 (B16) picture

Dec/Adac Corp. D4-10390 Rev 6 Model 1664ATTL Output Pulse Board 1983 (B16)

$189.99



VINTAGE Bruker Board DEC W4P3042 for SpectroSpin 250 picture

VINTAGE Bruker Board DEC W4P3042 for SpectroSpin 250

$50.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.