07-30-2008 02:16 PM
I'm getting started on blackberry development and I've encountered the following problem: my application is not loaded to the simulator.
I'm simulating a Pearl 8100, using Blackberry JDE 4.5.0. Honestly I'm believe I don't really know how this works. Build and run works just fine, and I do get the .cod, jad, jar, debug and other files. But the simulator does not load the app.
Then I moved to netBeans. NetBeans with mobility pack and the adaptation works just fine. It recognizes special Blackberry sintaxis and classes, managed to load the javadoc, and it even starts the simulator. Yet, my personal app is not loaded and the demo applications are still there.
I was hopeing you could help me out with some guidlines on what must be there for the simulator to pick up a new application.
Thanks in advance
March
07-30-2008 04:45 PM
07-30-2008 08:15 PM
The problem is the latter. I don't see an icon in the blackberry simulation for my application. I'm not sure I configure netBeans to load the application to the simulator. Yet, if on the simulator I click 'load java program' and select my .cod, it shows something working, but then nothing changes, and there's still no icon for my application.
07-31-2008 05:50 AM
Hi,
I use Netbeans too.
try to modify your build.xml like this:
<!-- Added to compìle and debug Blackberry -->
<property name="rim.blackberry.home" location="C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.2.1"/>
<property name="rim.blackberry.emulator" value="8100"/>
<property name="rim.blackberry.jdwp.port" value="8000"/>
<!-- Configuration Selector -->
<target name="init.rim.blackberry" depends="init">
<condition property="rim.blackberry" value="true">
<or>
<equals arg1="Blackberry" arg2="${config.active}"/>
</or>
</condition>
</target>
<!-- Post- Jar -->
<target name="post-jar" depends="init.rim.blackberry" if="rim.blackberry">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
dir="${dist.root.dir}/${config.active}"
executable="${rim.blackberry.home}/bin/rapc.exe"
failonerror="true"
resolveExecutable="true">
<arg value="import=${rim.blackberry.home}/lib/net_rim_api.jar"/>
<arg value="codename=${name}"/>
<arg value="-midlet"/>
<arg value="jad=${dist.jad}"/>
<arg value="${dist.jar}"/>
</exec>
<copy file="${name}.alx" todir="${dist.root.dir}/${config.active}"/>
</target>
<!-- Run Emu -->
<target name="run" depends="init.rim.blackberry" if="rim.blackberry">
<copy todir="${rim.blackberry.home}/simulator" verbose="true">
<fileset dir="${dist.root.dir}/${config.active}">
<include name="**/${name}.*"/>
</fileset>
</copy>
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
dir="${rim.blackberry.home}/simulator"
executable="${rim.blackberry.home}/simulator/${rim.blackberry.emulator}.bat"
failonerror="true" resolveExecutable="true"/>
</target>
<!-- debug -->
<target name="debug" depends="init.rim.blackberry" if="rim.blackberry">
<copy todir="${rim.blackberry.home}/simulator" verbose="true">
<fileset dir="${dist.root.dir}${config.active}">
<include name="**/${name}.*"/>
</fileset>
</copy>
<delete file="${preprocessed.dir}/.timestamp"/>
<parallel>
<property name="jpda.port" value="${rim.blackberry.jdwp.port}"/>
<java jar="${rim.blackberry.home}/bin/JDWP.jar" fork="true" dir="${rim.blackberry.home}/bin">
<jvmarg value="-Xmx128M"/>
</java>
<sequential>
<sleep seconds="5"/>
<antcall target="nbdebug"/>
</sequential>
</parallel>
</target>
<!-- Post Clean -->
<target name="post-clean" depends="init.rim.blackberry" if="rim.blackberry">
<echo>Post clean</echo>
<delete>
<fileset dir="${rim.blackberry.home}/simulator">
<include name="**/${name}.*"/>
</fileset>
</delete>
</target>
don't forget to create (by hand) an .ALX and
to Add RIM as a custom emulator:
hope this helps,
Christophe
PS: this is a copy of an article I found. Since, I did modify it for my own use. It may not work on the first try.
07-31-2008 10:37 AM
Ah thanks for the reply. I've just tried the code, but didn't work either. It does build the project, but does not open the simulator. Maybe I should check it a few times more. As the only thing I changed whas the "rim.blackberry.home" property. Didn't see anything else to change.
If it is not much trouble. I'd like to know what is the process that the XML is suppoused to do is, so I can do it manually and check that the problem is there. I'm afraid I may be loosing some imporant coding that makes the progam recognizable by the simulator.
08-08-2008 03:54 AM
hi,
does your config name contain the string "blackberry".
so the test
<condition property="rim.blackberry" value="true">
<or>
<equals arg1="Blackberry" arg2="${config.active}"/>
</or>
</condition>
can be true ?