BlackBerryForums.com : Your Number One BlackBerry Community  
   

»Sponsored Links




Reply
 
LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. (#1 (permalink)) Old
ppngiap Offline
New Member
 
Posts: 4
Join Date: Aug 2006
Model: 8700c
Default integrating eclipseME and BlackBerry SDK - 08-15-2006, 03:54 PM

Hi All,

My team is about to port J2ME app to BlackBerry. The J2ME app was developed on Eclipse using EclipseME (for mobile) and the team does not want to use the "crappy" JDE comes with the BlackBerry SDK. So as a new guy, I got the task. I think I figure out a relatively painless way of doing this and I'd like to share with you all.

I assume you have been using eclipseME for mobile development so I will skip all the unneccessary details regarding eclipseME ([eclipseme.org]).

1) Create a eclipseME HelloWorld project.

2) On the buildpath, add a reference to external JAR file, net_rim_api.jar.

3) Export the attena build files (right click on the project, J2ME->export antenna).

4) Added the following to user-build.properties (with the correct SDK path)
bb.buildjars.home=C\:\\Java\\j2me\\RIM\\BB_JDE_4.1 \\bin
bb.simulator=C\:\\Java\\j2me\\RIM\\BB_JDE_4.1\\sim ulator
bb.api.jar=C\:\\Java\\j2me\\RIM\\BB_JDE_4.1\\lib\\ net_rim_api.jar

5) Added the following line to HelloWorld.jad if you are using RIM UIApplication (very important, it took me a couple of hours to debug this), MIDlet-1: HelloWorld (for J2ME midlet, it is automatically added when u package the JAR file).

5.5) Needs to create HelloWorld.alx file:
<loader version="1.0" />
<application id="HelloWorld">
<description>Sample app</description>
<version>1.0</version>
<vendor>My vendor</vendor>
<fileset Java="1.0">
<files>HelloWorld.cod</files>
</fileset>
</application>
</loader>

6) Add the following targets to the build.xml exported by J2ME:
<!-- Package up for black berry debugging -->
<target name="bb_build" depends="jar" description="Package for black berry debugging">
<echo message="path.build.output=${path.build.output}" />
<wtkrapc jadfile="${path.build.output}/${midlet.name}.jad" source="${path.build.output}/${midlet.name}.jar" codename="${midlet.name}" import="${bb.api.jar}" destdir="${path.build.output}/cod" midlet="false" />
<antcall target="bb_copy" />
</target>

<!-- copy files to bb simulator -->
<target name="bb_copy" description="Copy files to BB simulator" >
<copy todir="${bb.simulator}" overwrite="true">
<fileset dir="${basedir}">
<include name="*.cod" />
<include name="*.debug" />
<include name="*.alx" />
<include name="*.cso" />
</fileset>
</copy>
</target>

<!-- unload the midlet to the black berry device -->
<target name="bb_unload" description="Unload the midlet to the BB device.">
<exec executable="${bb.buildjars.home}\javaloader.exe">
<arg line="-usb erase ${midlet.name}.cod" />
</exec>
</target>

<!-- load the midlet to the black berry device -->
<target name="bb_load" depends="bb_unload" description="Load the midlet to the BB device.">
<exec executable="${bb.buildjars.home}\javaloader.exe">
<arg line="-usb load ${basedir}\${midlet.name}.cod" />
</exec>
</target>

7) To debug, first u need to execute bb_build, then you need to start(create) a Java Remote Application session. See [www dot blackberry dot com/developers/forum/thread.jsp?forum=1&thread=7730&message=28238&q=ecl ipse#28238] for reference. (The forum does not allow me to post URL until I have more than 10 posts hence the dot).

I think that should cover it. I am in the process of convicing the eclipseME owner to do the BlackBerry plugin or helping me getting started. Until then, you will need to add one extra step (bb_build) before you can debug.

Note: I have yet to figure out how to do internationalization for BB app (.rrh) on eclipse. Might be someone can share his/her experience.

Cheers,
Tom

Last edited by ppngiap : 08-15-2006 at 04:19 PM.
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
ppngiap Offline
New Member
 
Posts: 4
Join Date: Aug 2006
Model: 8700c
Default 08-15-2006, 04:17 PM

Forgot step 5.5, needs to create .alx file:
<loader version="1.0" />
<application id="HelloWorld">
<description>Sample app</description>
<version>1.0</version>
<vendor>My vendor</vendor>
<fileset Java="1.0">
<files>HelloWorld.cod</files>
</fileset>
</application>
</loader>
   
Reply With Quote
  (#3 (permalink)) Old
Taras1 Offline
New Member
 
Posts: 13
Join Date: Jan 2006
Model: -
Default RAPC ant task - 08-16-2006, 02:43 AM

If you want to utilize BlackBerry-specific options of your J2ME project (icons, autostartup, etc.) you can also use RAPC ant task.
   
Reply With Quote
  (#4 (permalink)) Old
ZaBlanc Offline
Knows Where the Search Button Is
 
Posts: 19
Join Date: Aug 2006
Model: 7105T
Carrier: T-Mobile
Default RAPCS and stdout - 08-16-2006, 11:35 AM

Were you able to get STDOUT to be directed to the console where you ran the Ant task from? I still can't get that working...and I think it's because fledge is designed to be remote controlled (i.e., that's crap!)

As for the rapc task, the thing I find disturbing is that it builds all its files in the project's basedir. That is craptastic and a hideous implementation decision. Anyone have any workarounds?
   
Reply With Quote
  (#5 (permalink)) Old
Taras1 Offline
New Member
 
Posts: 13
Join Date: Jan 2006
Model: -
Default What's wrong? - 08-18-2006, 03:47 AM

There is no problem with output from RAPC ant task. If you want more details than a command line that is passed to RAPC compiler you can always remove options="-quiet" attribute from a project element.
Now about files that are built. Why do you think that it always builds all the files in the project's basedir? Files to be built are defined with the help of FileSet Ant type. If you customize FileSet to include all .java files in basedir it is your choice. But you can define more comples rules which files to build with the help of PatternSets and Selectors. So, the workaround is to read Ant manual.
   
Reply With Quote
  (#6 (permalink)) Old
yordan Offline
New Member
 
Posts: 2
Join Date: Oct 2004
Model: 7270
Default WtkRapc vs. RAPC ant task - 12-01-2006, 04:49 AM

Antenna's WtkRapc Ant task is designed for converting a MIDlet into a BB application (JAR -> COD), while "RAPC ant task" perfectly builds more sophisticated BB applications.
   
Reply With Quote
  (#7 (permalink)) Old
dolphinUK Offline
New Member
 
Posts: 2
Join Date: Feb 2007
Model: 8100
Default create alx using in eclipse? - 02-08-2007, 06:29 AM

I am trying to build the blackberry using eclipse and so far I got to the stage of converting to a cod format file but due no alx present, the build fails.

Does anyone know how to create an alx file or convert from jad to alx using an external tool that can be called using ant/antenna in eclipse same as calling the rapc to convert the jar to cod.

thanks,
   
Reply With Quote
  (#8 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 158
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default 02-08-2007, 07:12 AM

Just do it by hand, they are very simple and don't ever need to be updated. The example given above was:

Code:
<loader version="1.0" />
<application id="HelloWorld">
<description>Sample app</description>
<version>1.0</version>
<vendor>My vendor</vendor>
<fileset Java="1.0">
<files>HelloWorld.cod</files>
</fileset>
</application>
</loader>
Just change the values to your own
   
Reply With Quote
  (#9 (permalink)) Old
jfisher Offline
CrackBerry Addict
 
jfisher's Avatar
 
Posts: 706
Join Date: Jun 2005
Location: Manchester, UK
Model: 8310
Carrier: t-mobile
Default 02-08-2007, 07:32 AM

it's the same with netbeans - you create an .alx manually and automate it using the build script (build.xml):

<copy file="${name}.alx" todir="${dist.dir}"/>

if you have the time you could create a console app that reads the jad and writes out an alx as part of your build process but i'm not sure it's worth the effort.
   
Reply With Quote
  (#10 (permalink)) Old
tschiefer Offline
Knows Where the Search Button Is
 
Posts: 43
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Default Eclipse and Blackberry IDE - 07-05-2007, 04:21 AM

I'm trying to convince eclipse to work together with the Blackberry JDWP. I think i'm very close but it is not completely working yet. Would be nice, if someone could give me a hint.

Here is, what i've done so far:

1) Installed EclipseME on Eclipse
2) Created a new EclipseME Project
3) Read the Blackberry JDE Development Guide Appendix: The eclipse development and changed following things to eclipse:
3.1) Created a new JRE with net_rim_api.jar included
3.2) Created a new Builder for my project using the rapc.exe
and gave the builder the following arguments
-quiet C:\Development\J2MEProject\src\*.java import=”C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0\lib\net_rim_api.jar” codename="C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0\simulator\J2MEProject"

4) Implemented a simple HelloWorldApplication. Works fine in the Blackberry IDE - i've already tested it there.
5) Start JDWP
6) Run -> Debug Dialog -> Remote Java Application -> Debug

So far so good. In the ...BlackBerry JDE 4.1.0\simulator directory there pop up
J2METest.cod
J2METest.cso
J2METest.debug
J2METest.jar
J2METest.jad <-- this file doesn't appear, when i run HelloWorld from the Blackberry IDE

Problem is: In the BlackberrySimulator i don't find my J2METest Application under Applications.
So i generated a J2METest.alx file, which looks like this

<loader version="1.0" />
<application id="J2METest">
<description>Sample app</description>
<version>1.0</version>
<vendor>My vendor</vendor>
<fileset Java="1.0">
<files>J2METest.cod</files>
</fileset>
</application>
</loader

And i've read from the posting above, that i have to insert MIDlet-1: J2METest into the .jad file. So i've done that and it now looks like this

Manifest-Version: 1.0
RIM-COD-Module-Name: J2METest
RIM-COD-Module-Dependencies: net_rim_cldc
MIDlet-Jar-Size: 2269
RIM-COD-Creation-Time: 1183626839
MIDlet-Jar-URL: unknown
RIM-COD-URL: J2METest.cod
RIM-COD-SHA1: f3 a2 cd 15 46 2e cd 49 56 51 d2 19 33 ac 76 eb 0f 16 92 86
RIM-COD-Size: 884
MicroEdition-Configuration: CLDC-1.1
MIDlet-1: J2METest
MIDlet-Version: 0.0
MIDlet-Name: unnamed
MIDlet-Vendor: anonymous
MicroEdition-Profile: MIDP-2.0

Actually i have two .jad files, one in my eclipseMe project and one which is generated in the ...BlackBerry JDE 4.1.0\simulator directory.

I would be pleased about any idea.
If not absolutely necessary i rather would like to let antenna beside in this stage of development.
   
Reply With Quote
  (#11 (permalink)) Old
tschiefer Offline
Knows Where the Search Button Is
 
Posts: 43
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Default 07-06-2007, 03:38 AM

yeah, I did it. I wrote a .pdf, on where I did something wrong and how to do it the right way. Because the instruction above is for porting a MIDlet onto a Blackberry, what I didn't realized in first place.
What i want to do is creating Blackberry applications (.cod) and here is the way to how to do that.

Index of /~tschief/Div

Last edited by tschiefer : 05-19-2008 at 07:34 AM. Reason: new location for HowTo
   
Reply With Quote
  (#12 (permalink)) Old
shamnad Offline
New Member
 
Posts: 6
Join Date: May 2007
Model: 8100
PIN: N/A
Carrier: Hutch
Default 10-01-2007, 07:30 AM

I an using eclipse and JDE together.I mean I compile my programs in eclipse and copy paste it to JDE and then give a buildAll to generate cod files.
Recently I encountered a problem when i used ResourceBundle.I created rrh and rrc files.And in my java files i implemented the Interface(The rrh file name followed by "Resource") then eclipse is not able to compile the code.
Can anyone help me in this regard..
   
Reply With Quote
  (#13 (permalink)) Old
lionelp Offline
New Member
 
Posts: 4
Join Date: Oct 2007
Model: 8300
PIN: N/A
Carrier: Movistar
Default How to use Resourses RRH RRC with Eclipse? - 10-18-2007, 11:07 AM

Does anyone know how to user ResourcesBundle with Eclipse?

Regards,

Lionel
   
Reply With Quote
  (#14 (permalink)) Old
Ozarka Offline
New Member
 
Posts: 11
Join Date: Apr 2007
Model: 8100
Carrier: Cingular
Default 10-18-2007, 01:10 PM

Quote:
Originally Posted by lionelp View Post
Does anyone know how to user ResourcesBundle with Eclipse?

Regards,

Lionel
If you include the rrc, rrh, and init.java files rapc.exe will build them. The interface is built by the BB JDE, so if you want to use those constants in Eclipse, you have to make that file.
   
Reply With Quote
  (#15 (permalink)) Old
lionelp Offline
New Member
 
Posts: 4
Join Date: Oct 2007
Model: 8300
PIN: N/A
Carrier: Movistar
Default Resources Files RRH and RRC with Eclispe - 10-19-2007, 09:53 AM

Does anyone could explain in details how to use Eclipse with Resources Files? And How to compile?

I use EclipseME and Antenna.

Regards,

Lionel
   
Reply With Quote
  (#16 (permalink)) Old
New Member
 
Posts: 1
Join Date: Nov 2007
Model: 831-
PIN: N/A
Carrier: AT&T
Default great idea but broken link - 11-18-2007, 02:57 PM

i'd be very interested in taking a look at this document, but the url doesn't seem to be working any more

is there an updated link?

Quote:
Originally Posted by tschiefer View Post
yeah, I did it. I wrote a .pdf, on where I did something wrong and how to do it the right way. Because the instruction above is for porting a MIDlet onto a Blackberry, what I didn't realized in first place.
What i want to do is creating Blackberry applications (.cod) and here is the way to how to do that.

www.eltoro.at.tt/Div
   
Reply With Quote
  (#17 (permalink)) Old
JoaoGalli Offline
New Member
 
Posts: 7
Join Date: Apr 2007
Model: 8320
PIN: N/A
Carrier: TIM
Lightbulb Proguard - 02-27-2008, 07:41 PM

Hi, do you know how to use Proguard obfuscation with this build.xml?
   
Reply With Quote
  (#18 (permalink)) Old
tschiefer Offline
Knows Where the Search Button Is
 
Posts: 43
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Default Location for HowTo changed - 05-19-2008, 07:32 AM

sorry i wasn't paying attention, that the address wasn't reachable.
Following link is working:

Index of /~tschief/Div
   
Reply With Quote
  (#19 (permalink)) Old
pa4o85 Offline
Thumbs Must Hurt
 
Posts: 133
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Default 06-12-2008, 05:56 AM

I have a problem that still can not solve. I have a project in Eclipse, build it, start it on the simulator. But when I want to debug the application, I have some problem. I made the same steps as typed in the .pdf file, but when I am trying to debug through JDWP using Eclipse I put some breakpoints, started the simulator but the application I want to open, is not opening, but the simulator is launched. When I go to the application by myself and open it, it is working, but the breakpoints are not working, the application is not stopping where the breakpoints are set. System.out.println() is working but it is better to debug in the ordinary way with breakpoints and to see the values of the properties and arguments in the application. Is there anyone that knows where is the problem? Thanks !
   
Reply With Quote
  (#20 (permalink)) Old
omrib Offline
Knows Where the Search Button Is
 
Posts: 16
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: Orange
Default 06-13-2008, 05:30 AM

why not use RIM's blackberry plugin for eclipse?
   
Reply With Quote
  (#21 (permalink)) Old
pa4o85 Offline
Thumbs Must Hurt
 
Posts: 133
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Default 06-13-2008, 06:44 AM

Because I think it is still buggy. It is a beta version. I am waiting for the official release.
   
Reply With Quote
  (#22 (permalink)) Old
omrib Offline
Knows Where the Search Button Is
 
Posts: 16
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: Orange
Default 06-13-2008, 09:37 AM

I'm using it and it works nicely.
and RIM are giving free email support for it.
   
Reply With Quote
  (#23 (permalink)) Old
pa4o85 Offline
Thumbs Must Hurt