This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes JSR 82, WTK2.1 and WTK2.2 issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "JSR 82, WTK2.1 and WTK2.2 issues" Watch "JSR 82, WTK2.1 and WTK2.2 issues" New topic
Author

JSR 82, WTK2.1 and WTK2.2 issues

Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
What are the things do i need so that i can develop bluetooth programs on a mobile phone(NOKIA)?

I have downloaded WTK2.1 but it says it does not have JSR-82 support..
But i have the JSR-82 source files, so i was wondering if i could just compile those source files and i can get bluetooth up and running with my program just like that.

Now there is WTK2.2 beta and it has JSR-82 support in it already.. But the problem is i'm using EclipseMe plugin for Eclipse but it doesn't have WTK2.2 support yet..

So can i just compile the java source files of JSR-82 and i can use bluetooth already in my programs? I tried to compile the source files but then when i run the program, with bluetooth functions in it, it caughts an exception: "NoClassDefFoundError"..

Or should I have to use WTK2.2 and change to another IDE?


it's alright, the gun isn't loaded... - hey
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
The JSR 82 "source code" is only the interface to bluetooth. It does not contain any implementation. So, it is completely useless to compile them. To use bluetooth with WTK, you have to upgrade to v2.2 and above.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Alexander Traud
Greenhorn

Joined: Jul 07, 2004
Posts: 16
Put the JSR-82 stub files you have into the class path and compile. You should be able to run it then on your Nokia mobile phone. But please remember - currently only these two Nokia mobile phones Nokia 6600 and Nokia 6230 support JSR-82 and do not include these stubs into the JAR. There are not muc more which do at the moment (Siemens SX1, Sony Ericsson P900 both with latest firmware) but there are coming a lot more this year.

You do not need any Bluetooth implementation within these stubs. But then you have to do all your testing on a real device. If you want to test your Bluetooth application, I recommend either the WTK 2.2 or a J2ME emulator from Nokia. Personally I work with the Nokia 6230/6600/9500 Concept SDKs under Linux and EclipseME successfully.

The Windows version from Nokia allow even more features.

In my small experince EclipseME is great for the start but it makes not very good real MIDP apps in the output. In my case I had to enable Java 1.1 compatible class generation, manually redoing the preverifying and package the JAR correctly. Even the outputed MANIFEST.MF is wrong according to MIDP 1.0 specification. Anyway I use it. :roll:
[ July 10, 2004: Message edited by: Alexander Traud ]
Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
thanks alot for the info guys..

neways i just got a 6230 SDK from Nokia, and it has JSR-82 already..so i think thats just what i need..

to alex: what do you mean EclipseMe does not produce very good MIDP applications?

Do you mean like an MIDP app compiled on a Netbeans will be much better than EclipseMe?
Alexander Traud
Greenhorn

Joined: Jul 07, 2004
Posts: 16
EclipseME makes not very good JAR files. The classes are not preferified sometimes (have not figured out why yet), it is not compiled with Java 1.1 compatible byte code (can be fixed via the project settings or better via the preferences of Eclipse) and the JAR is filled with unnecessary files (I see no possible solution for this). I read the full documentation - perhaps I am too stupid. Anyway the JAD and the MANIFEST file need fine tuning, so I have to repackage it anyway.

EclipseME is great for the developing and debugging phase but when it comes to the final release, you'll have to go over it manually.

But I think my next (very) big J2ME project will be made within a text editor and the command line utilities. Eclipse is too slow here and sometimes the behaviour is obscure.
[ July 11, 2004: Message edited by: Alexander Traud ]
Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
okei dude.. thanks for the heads up..

so how do i go over it manually? Would u suggest also that i compile my MIDP apps on a different IDE, say for example, Netbeans?
Alexander Traud
Greenhorn

Joined: Jul 07, 2004
Posts: 16
Javac is javac. The classes won't get better in an IDE nor do they get worse. It depends on the javac options. Compiling was no problem yet.

How to do it manually? You know the command prompt and "jar" and "preverify"? These command line utilities are your way. Look at their parameters and you will find it. "preverify" does not need an option, just the file and your classpath. "jar" needs several options. Just look for a reference on the net or look into their help pages. I can't give a "general" rule here - it is just passing the right paramters to these apps.
Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
tnx dude!!

one last question though..

dude, how do you install a midlet on a 6230 phone? i tried to copy the jar file thru bluetooth... but when i open it from the phone, it says, "file format not supported"..
Alexander Traud
Greenhorn

Joined: Jul 07, 2004
Posts: 16
Either over the air or the Nokia Content Copier (came on the Nokia 6230 CD-ROM). The Nokia SDK allows it to.
Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
So i cant do it thru bluetooth huh?

OTA, meaning thru SMS?
Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
Alex,

Dude i have another question to you since you are using EclipseMe also.. and noone is answering my post regarding this topic.. hehe

Ahm, im trying out the Series40 SDK(Nokia) with EclipseMe.. I made a simple HelloWorld MIdlet, it supposed to display a "hello world" text.. When I tried to run it thru the Run menu of Eclipse, the 6230 emulator appears, but after a while the emulator will give an error message "Invalid File".. and the midlet doesn't run..

What does this mean?

I tried to run this midlet using a different wireless toolkit(Suns J2ME wireless toolki) and its runs ok..
Alexander Traud
Greenhorn

Joined: Jul 07, 2004
Posts: 16
I recommend to buy a book about Java 2 Micro Edition (J2ME) and CLDC/MIDP. Over the air is done via WAP/HTTP connection. With the Nokia Content Copier you can load your MIDlet via cable, infrared and Bluetooth to your phone. The Nokia SDK even contains this application - it was installed while it installed the emulator...

Nokia Forum has a lot and extremly good documentation about J2ME, too.

Your other question is too "generic". It could be nearly everything. You read the outstanding EclipseME documentation? You have the latest version(s)?
Anthony Yulo
Ranch Hand

Joined: Feb 22, 2003
Posts: 52
Dude!

I just posted to the EclipseMe mailing list and apparently its a bug when integrating EclipseMe and Series40 SDK.. What i'm doing now is im just compiling with EclipseMe, and then i'm emulating it and creating a package with Nokia Developer Suite..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSR 82, WTK2.1 and WTK2.2 issues
 
Similar Threads
Bluetooth Development
phone as bluetooth - server / client
Uncaugh Exception NoclassDefFoundError
J2ME + Bluetooth?
How to use Bluetooth API JSR82