views:

205

answers:

1

Hi all,

I need some way to communicate between J2SE app and j2me midlet running in emulator in netbeans. how can i achieve this?

Abdul Khaliq

A: 

Well, technically, Netbeans is a J2SE application so you are already doing this everytime you launch the J2ME emulator.

I expect that when Netbeans launches the emulator, it does it in a way that sends the emulator standard output and standard error back to Netbeans. Presumably using the emulator executable command line parameters. That is one-way communication though.

The debugger inside Netbeans uses a standard protocol to retrieve information and manipulate the emulator:

http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jpda.html

Of course, using this still restricts what you can do.

Since the emulator is meant to represent a phone, the only pure-Java to pure-Java communication channel is networking. That means opening a tcp, udp or http connection between the two environments. Of course, getting this to work once you put your J2Me application on an actual phone will require quite a bit of setup on the J2SE side of things.

QuickRecipesOnSymbianOS