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
Developer
marcelruff
Posts: 22
Registered: ‎12-01-2009
My Device: Not Specified
Accepted Solution

How to port existing J2ME app to BlackBerry

Hi,

 

I have several existing J2ME apps (for Sony Ericsson, Nokia etc) CLDC1.1 MIDP 2.0.

Now I would like to run them on BlackBerry.

 

Usually I'm using the newest eclipse 3.5.1 (using MTJ and in history eclipseme),

but had to downgrade to 3.4.1 to get BlackBerry IDE plugin installed (correct or is there a way to stay with eclipse 3.5.1?)

 

The BlackBerry HelloWorld runs now fine in the simulator.

 

But how can I tell my existing J2ME Midlet eclipse projects to be BlackBerry aware?

How to run them on the BlackBerry simulator or on real BlackBerry devices?

 

Thanks
Marcel

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1154, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: How to port existing J2ME app to BlackBerry

Technically your app should be fine as is. If you want to replace J2ME classes with native components then you create a new project, set the app settings to a BlackBerry app instead of MIDlet and change the UI code. Then you will have a native Blackberry app. If you want the app to remain cross-platform compatible then, as stated before, you are already done.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Developer
marcelruff
Posts: 22
Registered: ‎12-01-2009
My Device: Not Specified

Re: How to port existing J2ME app to BlackBerry

Hi,

 

thanks for the response.

 

However, I experience several problems deploying MyApp.jad and MyApp.jar:

 

1) I can't deploy it onto the BlackBerry 8800 T-Mobile test device i got today:

- Bluetooth seems to be not supporting OBEX

- No WLAN support

- OTA seems to fail as I use a E-Plus SIM card in a T-Mobile device (I believe this is somehow prohibited)

- USB cable with "Desktop Manager": I couldn't find out how to copy jad/jar to the BlackBerry directly

 

-> Now I create a MyApp.cod (with javaloader.exe) and an MyApp.axl XML file as a descriptor to be able to copy with "Desktop Manager" to the device.

Now the MyApp.jar starts fine (after changes as described in 2))

 

2) The created jar is obfuscated with proguard which worked fine for other mobile phones, but on BlackBerry I get:

  Parsing classfile: k.class
    MyApp.jar(k.class): Error!: Duplicate definition for 'k' found in: k

  Setting with proguard: -dontusemixedcaseclassnames -dontnote -defaultpackage ''

  didn't help (I hoped it could be a case insenitive thingi).

  Now I don't obfuscate anymore, and the app starts on BlackBerry.

 

3) How can I debug the Midlet code on the simulator or on the BlackBerry directly with my eclipse setup?

I would like to keep the cross platform jad/jar project, but no "BlackBerry" specific menu is visible in

the Midlet project (as in a HelloWorld Blackberry project).

 

Thanks

Marcel

Please use plain text.
Developer
guy7373
Posts: 28
Registered: ‎09-24-2009
My Device: Not Specified

Re: How to port existing J2ME app to BlackBerry

 

1) try downloading the jad and jar to the device SD card using the desktop manger media software.

on the device go to media->explore browse the download folder and activate the jad.

I think it works the same as OTA.

 

2) the BB has issues with obfuscated packages. there is an option in proguard to obfuscate the jar to be one level, i.e. no packages. 

Please use plain text.
Developer
sahil_khanna
Posts: 112
Registered: ‎07-19-2009
My Device: Not Specified

Re: How to port existing J2ME app to BlackBerry

Try the following.

 

  • Copy the .Jad and .Cod files into your device using the Desktop Manager through Media Manager in it.
  • Run the .Jad file which will allow you to install the application.

  • If required, get the application signed

Please use plain text.
New Developer
spring_sojwal
Posts: 3
Registered: ‎08-11-2009
My Device: Not Specified

Re: How to port existing J2ME app to BlackBerry

Marcel,

 

You can use the beta version of Blackberry Java plug-in (1.1.1) for Eclipse 3.5.1.

 

Regards.

Please use plain text.
Developer
marcelruff
Posts: 22
Registered: ‎12-01-2009
My Device: Not Specified

Re: How to port existing J2ME app to BlackBerry

[ Edited ]

Thank you, I have done this now.

 

I have described my approach (the steps needed) in another thread:

http://supportforums.blackberry.com/t5/Java-Development/How-debug-normal-midlet-eclipse-project-with...

 

I close this thread, the other thread is still open to gather more informations about this issue.

 

Marcel

Please use plain text.
Developer
rcmaniac25
Posts: 1,804
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1154, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: How to port existing J2ME app to BlackBerry

You should provide a link to the other thread so if someone else has this problem they can find where you put the steps to resolve this. You should also mark this as solved.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.