Skip to main content
GameDev.net gamedev.net
🔒 Locked

Just starting

Started by Stevieboy Oct 27, 2005 at 10:07 PM 2 replies 1k views
Original Post
Stevieboy
Stevieboy
Hi, I've been thinking about trying some cellphone programming, I've got netbeans and the mobile (thingy) library. Do I need to learn Java, (or what), to program with J2ME, will getting a general book on java programming be the thing to do? Also really not sure how to do anything, I'm looking for the equivelent of .h files & cpp files etc, also where would the program entry point be? oh well. lol - noob again. p.s. I have 2 and a bit years c++ experience.
shmoove
shmoove
Yeah, you need to know the basics of Java, since that's the language you will be using. A beginners book on Java (Java in a Nutshell from O'Reilly for instance) would help you there.

Then you'll need a book on J2ME, since the libraries for J2ME are not the same. Although, if you get a good grasp on Java, some online tutorials might be enough to get you started (J2ME is still pretty small).

There are no header files in Java, only source file (*.java) which are then compiled into the class files (*.class) which are the executables.

The entry point for MIDlets are kind of 2: the MIDlet constructor and the MIDlet.startApp() method.

Check the "I want you to suggest..." sticky thread for a lot of links to resources for mobile programming.

shmoove
Stevieboy
Stevieboy
Thanks Shmoove, those links in the sticky look quite good.
Can you learn Java by using J2ME, or is it better to start with Java on its own? Is there a Java console or something? I've never touched Java before, the only things I'm going on at the moment is that it's extended from c++, -(if you know c++, learning java probably won't be so hard).

I think I'll be ok with the language (I got a couple books from my local library today), so I don't think learning the types, uses etc will be much of a problem, I think my main problems will be more like how to set the compiler up, how to include libraries, how to use the libraries, how to know what target I'm actually trying to program for?

Any way thanks again.
shmoove
shmoove
Quote:
Original post by Stevieboy
Can you learn Java by using J2ME, or is it better to start with Java on its own?

Sure you can, but most books and tutorials on J2ME assume a basic knowledge of Java, so finding resources that will teach it directly with J2ME might be a problem.

Quote:

Is there a Java console or something?

Console as in console applications? If so, then yes, the desktop version of Java will run applications as console applications by default. It's as easy as using the System.out and System.in classes.

Quote:

I've never touched Java before, the only things I'm going on at the moment is that it's extended from c++, -(if you know c++, learning java probably won't be so hard).

I think I'll be ok with the language (I got a couple books from my local library today), so I don't think learning the types, uses etc will be much of a problem, I think my main problems will be more like how to set the compiler up, how to include libraries, how to use the libraries, how to know what target I'm actually trying to program for?

Any way thanks again.

It's not extended from C++, it just has a similar syntax, and shares a few of the paradigms. But it certainly shouldn't be a problem for anyone with good C++ experience. If you want a very quick way to jump in and get something running on the phone, you could try the (a bit antiquated, but still quite relevant) Java Tutorial Trail Map. You could go through the first two chapters ("Getting started" and "Learning the Java language") and then jump into one of the J2ME tutorials linked in the sticky. Because after that they start going into J2SE specific stuff. Although making a few applets (the third chapter) might also come in handy because there are many similarities between applets and MIDlets (J2ME apps are called MIDlets).

And for someone coming from C++ this tutorial might also come in very handy.

shmoove

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.