BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-15-2006, 03:54 PM   #1
ppngiap
New Member
 
Join Date: Aug 2006
Model: 8700c
Posts: 4
Default integrating eclipseME and BlackBerry SDK

Please Login to Remove!

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..
Offline  
Old 08-15-2006, 04:17 PM   #2
ppngiap
New Member
 
Join Date: Aug 2006
Model: 8700c
Posts: 4
Default

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>
Offline  
Old 08-16-2006, 02:43 AM   #3
Taras1
New Member
 
Join Date: Jan 2006
Model: -
Posts: 13
Default RAPC ant task

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

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?
Offline  
Old 08-18-2006, 03:47 AM   #5
Taras1
New Member
 
Join Date: Jan 2006
Model: -
Posts: 13
Default What's wrong?

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.
Offline  
Old 12-01-2006, 05:49 AM   #6
yordan
New Member
 
Join Date: Oct 2004
Model: 9000
Carrier: vodafone
Posts: 2
Default WtkRapc vs. RAPC ant task

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.
Offline  
Old 02-08-2007, 07:29 AM   #7
dolphinUK
New Member
 
Join Date: Feb 2007
Model: 8100
Posts: 2
Default create alx using in eclipse?

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,
Offline  
Old 02-08-2007, 08:12 AM   #8
bdowling
Thumbs Must Hurt
 
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Posts: 181
Default

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
Offline  
Old 02-08-2007, 08:32 AM   #9
jfisher
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Default

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.
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Old 07-05-2007, 04:21 AM   #10
tschiefer
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Posts: 44
Default Eclipse and Blackberry IDE

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.
Offline  
Old 07-06-2007, 03:38 AM   #11
tschiefer
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: t-mobile
Posts: 44
Default

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
Offline  
Old 10-01-2007, 07:30 AM   #12
shamnad
New Member
 
Join Date: May 2007
Model: 8100
PIN: N/A
Carrier: Hutch
Posts: 6
Default

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..
Offline  
Old 10-18-2007, 11:07 AM   #13
lionelp
New Member
 
Join Date: Oct 2007
Model: 8300
PIN: N/A
Carrier: Movistar
Posts: 4
Default How to use Resourses RRH RRC with Eclipse?

Does anyone know how to user ResourcesBundle with Eclipse?

Regards,

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

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.
Offline  
Old 10-19-2007, 09:53 AM   #15
lionelp
New Member
 
Join Date: Oct 2007
Model: 8300
PIN: N/A
Carrier: Movistar
Posts: 4
Default Resources Files RRH and RRC with Eclispe

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

I use EclipseME and Antenna.

Regards,

Lionel
Offline  
Old 11-18-2007, 03:57 PM   #16
scottiandavidoff
New Member
 
Join Date: Nov 2007
Model: 831-
PIN: N/A
Carrier: AT&T
Posts: 1
Default great idea but broken link

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
Offline  
Old 02-27-2008, 08:41 PM   #17
JoaoGalli
New Member
 
Join Date: Apr 2007
Model: 8320
PIN: N/A
Carrier: TIM
Posts: 7
Lightbulb Proguard

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

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

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

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 !
Offline  
Old 06-13-2008, 05:30 AM   #20
omrib
Knows Where the Search Button Is
 
Join Date: Apr 2008
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 26
Default

why not use RIM's blackberry plugin for eclipse?
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


Schneider Electric Energy Server EBX510 Server For Energy Management- picture

Schneider Electric Energy Server EBX510 Server For Energy Management-

$4350.00



SERVER TECHNOLOGY 4870-XLS-44 SENTRY VDC 48VOLT DC REMOTE POWER MANAGER picture

SERVER TECHNOLOGY 4870-XLS-44 SENTRY VDC 48VOLT DC REMOTE POWER MANAGER

$299.99



Moxa NPort 5232 Device Server 2-Port RS-422/485 picture

Moxa NPort 5232 Device Server 2-Port RS-422/485

$29.99



Moxa NPort 5230 Device Server 2-Port RS-422/485 picture

Moxa NPort 5230 Device Server 2-Port RS-422/485

$29.99



AVAYA S8300E S3 V1 Media Server 700508955 W/ 320GB Hard Drive 16GB RAM picture

AVAYA S8300E S3 V1 Media Server 700508955 W/ 320GB Hard Drive 16GB RAM

$249.00



Server - 82700 - 1 1/2 Qt Mini Warmer picture

Server - 82700 - 1 1/2 Qt Mini Warmer

$150.00







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