Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Marchudichu
Posts: 3
Registered: ‎07-30-2008
My Device: Not Specified

Adding a new app to the simulator

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 

Please use plain text.
Administrator
MSohm
Posts: 14,521
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Adding a new app to the simulator

Does your application fail to run (start) or do you not see an icon for it in the BlakcBerry Simulator?  If it is the former, what error or exception do you get?  If it is the latter and you are creating a MIDlet, please ensure that you have changed the application type from the default BlackBerry CLDC Appliction to MIDlet.  This is done by right clicking on the project in the BlackBerry JDE, selecting Project Properties, clicking on the Application tab and changing the type of application.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
Marchudichu
Posts: 3
Registered: ‎07-30-2008
My Device: Not Specified

Re: Adding a new app to the simulator

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.

 

Please use plain text.
Developer
Christophe
Posts: 39
Registered: ‎07-21-2008
My Device: Many
My Carrier: Many

Re: Adding a new app to the simulator

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:

  • Select Tools > Java Platform Manager from the top navigation bar.
  • Click the Add Platform button.
  • Select the Custom Java Micro Edition Platform Emulator radio button and click the Next button.
  • The Platform Home should be JDE installation directory (C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0), you can enter whatever you want for Platform Name and Device Name. Don't change anything else and press Next.
  • You will get to "Bootsrap Libraries" panel and see a pretty long list of jar files, select all of them except net_rim_api.jar and press Remove.
  • Next to Sources and JavaDoc, click Add at JavaDoc and type in or browse to: C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0\docs\api\ then select the Finish button.

 

 

 

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.

 

Please use plain text.
New Developer
Marchudichu
Posts: 3
Registered: ‎07-30-2008
My Device: Not Specified

Re: Adding a new app to the simulator

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.

Please use plain text.
Developer
Christophe
Posts: 39
Registered: ‎07-21-2008
My Device: Many
My Carrier: Many

Re: Adding a new app to the simulator

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 ?

 

 

Please use plain text.