MIDLet newbie questions

R

Rhino

I've been toying with the idea of writing some MIDlets for my PDA for quite
a while. I think I'm just about ready to give it a try but I need to get
some basic questions out of the way first.

I started by looking at Darryl Pierce's MIDlet FAQ at
http://bellsouthpwp.net/m/c/mcpierce/j2mefaq.html. I'm afraid that some
parts of it are a bit over my head and assume a bit more prior knowledge
than I have so please don't RTFM me ;-) I've been coding in Java since the
1.02 JDK but I've never tacked anything like J2ME before so please bear with
some silly newbie questions if you can....

I'm getting a bit confused about everything I need to have in place before I
can write some code. By the way, the device I want to write for is my new
Palm Tungsten E running Palm OS 5.2.1. (It would be neat if the code I write
can also run successfully on some of my friends' PDAs but I don't know
offhand exactly what models or OS versions they have so I suppose I'll just
worry about my own PDA for now; however, if it is fairly easy to write
MIDlets that work on other PDAs, please tell me what else I need to do.)

Darryl's FAQ says I need:
- at least a JDK 1.3 (or higher); I have JDK 1.5 beta2
- the reference iimplementation for the targeted profile; I downloaded
MIDP-2.0 because that is what my PDA runs
- the reference implementation for the targeted configuration; I downloaded
CLDC-1.1 because that is what my PDA runs
- Ant (I already had Ant 1.6.1 on my system)

(By the way, I downloaded the MIDlet HQ and the Java Demo for my Tungsten E
when I installed the optional applications; the Java Demo tells me that I am
running MIDP-2.0 and CLDC-1.1.)

I assume that the above items will be sufficient to develop code, once I get
it set up properly. However, I'm not sure what I need to *do* with the CLDC
and the MIDP reference implementations.

I created a MIDlet project in Eclipse, my development IDE, and created a
class to hold the HelloWorld code that Darryl gives in the FAQ. However,
none of the imports works, including Command, CommandListener, Display,
Displayable, Form and MIDlet (all prefixed by 'java.microedition.lcdue.').
All of these classes are in the MIDP zip file. To what destination should I
unzip the files in the zip file? Also, to what destination should I unzip
the CLDC zip file? Do I need to do anything beyond unzipping these zip
files, such as compiling something?

Is it a good or bad idea to do my development in Eclipse (2.1.3)? I'm not
sure if it would be better to keep my Midlet development activities separate
from Eclipse or not. If I am better off to avoid Eclipse, how should I do my
development? (I am not afraid of using the command line if that is better.)

I also need to test my code when it is written. From the FAQ, I know that
there are a variety of emulators that enable me to test on my PC before
trying the code on the PDA. Since I have no experience with any of the tools
suggested in the FAQ, I downloaded the latest Sun Wireless Toolkit. Is that
a good move under the circumstances or would I be better to use the Palm OS
5 emulator?

Am I correct in believing that the only thing I need to do to sent my tested
application to the PDA is HotSyncing it via the cable?

Sorry for the long post but I guess I have several issues that I need to
sort out before I can start developing so I thought I'd ask all the critical
questions at once ;-)

Rhino











--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare
 
D

Darryl L. Pierce

Rhino said:
I've been toying with the idea of writing some MIDlets for my PDA for
quite a while. I think I'm just about ready to give it a try but I need to
get some basic questions out of the way first.

I started by looking at Darryl Pierce's MIDlet FAQ at
http://bellsouthpwp.net/m/c/mcpierce/j2mefaq.html. I'm afraid that some
parts of it are a bit over my head

Sorry about that. I want the FAQ to be easy to read, but I guess I
personally get too technical at times. If you can give me particulars I can
try to word it a bit better.

I'm getting a bit confused about everything I need to have in place before
I can write some code. <snip>

Darryl's FAQ says I need:
- at least a JDK 1.3 (or higher); I have JDK 1.5 beta2
- the reference iimplementation for the targeted profile; I downloaded
MIDP-2.0 because that is what my PDA runs
- the reference implementation for the targeted configuration; I
downloaded CLDC-1.1 because that is what my PDA runs
- Ant (I already had Ant 1.6.1 on my system)
I assume that the above items will be sufficient to develop code, once I
get it set up properly. However, I'm not sure what I need to *do* with the
CLDC and the MIDP reference implementations.

I wrote that part a long time ago, when I thought downloading the Wireless
Toolkit and integrating it into a build environment was too much work. Now,
since I use Eclipse, I've found that integrating Eclipse, the EclipseME
plugin and Sun's Wireless Toolkit I have a much better environment than I
had before.
I created a MIDlet project in Eclipse, my development IDE, and created a
class to hold the HelloWorld code that Darryl gives in the FAQ. However,
none of the imports works, including Command, CommandListener, Display,
Displayable, Form and MIDlet (all prefixed by 'java.microedition.lcdue.').

Did you build the CLDC and MIDP reference implementations? And, did you
include the JAR files they produce in your bootclasspath reference when
building?
All of these classes are in the MIDP zip file. To what destination should
I unzip the files in the zip file? Also, to what destination should I
unzip the CLDC zip file? Do I need to do anything beyond unzipping these
zip files, such as compiling something?

You don't unzip them. They are included in your bootclasspath command line
for javac.
Is it a good or bad idea to do my development in Eclipse (2.1.3)? I'm not
sure if it would be better to keep my Midlet development activities
separate from Eclipse or not. If I am better off to avoid Eclipse, how
should I do my development? (I am not afraid of using the command line if
that is better.)

Your best best is to get Eclipse 3.x and EclipseME and Sun's Wireless
Toolkit 2.x. This is a complete environment for MIDP development.

<snip>

--
/**
* @author Darryl L. Pierce <[email protected]>
* @see The Infobahn Offramp <http://mcpierce.multiply.com>
* @quote "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
*/
 
M

Martin Brehovsky

Is it a good or bad idea to do my development in Eclipse (2.1.3)? I'm not
sure if it would be better to keep my Midlet development activities separate
from Eclipse or not. If I am better off to avoid Eclipse, how should I do my
development? (I am not afraid of using the command line if that is better.)

Why not to give a try to NetBeans 4.0 beta with it's mobility support.
AFAIK this tool has currently the most extensive support for developing
MIDP applications and very stable debugging support (even things like
on-device debugging on SonyEricsson). And it comes with the latest
wireless toolkit, which supports 3D api and many other things.

For details look at <http://www.netbeans.org/kb/articles/mobility.html>.
On this page there is also a ling from which you can download the pack.

B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top