wood burning stoves 2.0
The moose likes Java Micro Edition and the fly likes Newbie to J2ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Newbie to J2ME" Watch "Newbie to J2ME" New topic

Newbie to J2ME

Igor Janicki

Joined: Mar 18, 2012
Posts: 8


I am newbie to J2ME. However having a nice experience with Java, J2EE ... since JDK 1.02 up to JDK 1.6

Now involved in no so complex project for mobile. A MIDlet with HTTP network communication. The crucial problem is receiving and parsing XML data.

● I have installed Java_ME_platform_SDK_3.0.5, SPRINT WTK and J2ME plugin for Eclipse.
● I decided to use Eclipse due to my experience with the framework. I use Version: 3.5.2
● I selected kxml2 for XML parsing and handling.
● the anticipated target (first approach) is MIDP-2 with CLDC-1.1
● my OS is Vista (I know ... ).

Unfortunately I faced some troubles. (for a newbie).

* The first one is related to emulator, which does not work so good. Just launched test starts slowly ending with message "couldn't connect to virtual machine.". So I found that I can use the displayed emulator interface to load relevant jad file.

May be I have to install another devices ...

The one I tried to use is:

* The second is debugging of HTTP connection. Is it possible to do it making simple Java tests ?

I added a standard main() method (as I used to do in normal Java projects)


HttpConnection connection = (HttpConnection)Connector.open(url);

returns null

what's wrong ?

I would appreciate any suggestion or even a hint.

Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
Igor Janicki wrote:I added a standard main() method (as I used to do in normal Java projects)

Java ME doesn't use the main() method. You need to extend the javax.microedition.midlet.MIDlet class with a subclass and implements these methods: destroyApp(), pauseApp(), startApp().
It is sorta covered in the JavaRanch Style Guide.
subject: Newbie to J2ME
It's not a secret anymore!