Skip to main content

newbie issues

11 replies [Last post]
orlandobarrera
Offline
Joined: 2010-03-08

Good day, well im new to JavaME CDC, and im having a little problems to test my applications in the phoneme advanced for personal profile platform.

The deal is that im not sure is my link file is not well specified or it cannot load the classes from the jar file.. this is the lnk file im tryin:

97#"\Program Files\pMEA PP\bin\cvm.exe" -cp "\Program Files\pMEA
PP\cdcapplication1.zip" cdc.Testing

the paths are correct.

When i try to run the file i get the java console outputting an ClassNotFoundException but it closes automatically so i cannot tell exactly what the exc says...

That app is just a g.drawString outputting a Hello World

I dont know is the file need some extra parameters or the .jar file is not correct.

I hope somebody colud help me, thx in advance

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
orlandobarrera
Offline
Joined: 2010-03-08

hey thnk you very mucho for the info davy, it was really usefull, and now i finally got my apps working.

Now im having another problem, hope you could help me, im trying develop an small application to exchange data between bluetooth devices, via an AWT GUI, using CDC/PP.

Im not really sure if its posible to implement bluecove on this configuration, but so far i havent had any problems running the app, the problem is that im not getting the LocalDevice, the app trows a BluetoothStateException.

My PDA dont have a built-in bluettoth stack, im using a CF bluetooth card, which supports the drakar bluetooth stack, but im not sure if bluecove supports this stack, any suggestions?

davyp
Offline
Joined: 2007-01-03

If BlueCove does not support your bluetooth stack, then I am afraid I cannot help
you with this one.

Davy

orlandobarrera
Offline
Joined: 2010-03-08

well... i was afraid of that, but, how can i be completely sure that my stack is not supported? does the BluetoothStateException is thrown because and unsupported stack? or, could it be any other reason?

thx in advance

davyp
Offline
Joined: 2007-01-03

It could also be a bug in your application (unless of course, you know that your application
works on another device). The BluetoothStateException is thrown when you request an
operation that is not supported while the BT stack is in a particular state.

The official documentation of the Bluetooth JSR 82 specification from Sun available at
http://java.sun.com/javame/reference/apis/jsr082/javax/bluetooth/Bluetoo...
does not help much, but the following link of the Avetana bluetooth stack has more details:
http://www.avetana-gmbh.de/avetana-gmbh/produkte/doc/javax/bluetooth/Blu...

Regards
Davy

orlandobarrera
Offline
Joined: 2010-03-08

well.. it turned out that my PDA do use the microsoftt bluetooth stack, so i finally got bluecove working so far (at this point i can get the local device and start an inquiry for remote devices), your helf has been very useful davy, thx a lot

And again, i have another issue jeje... this time concerning on pME Advance. the thing is that after i close my app, it seems like .zip file where i pack my classes remain in use by pMEA, cause im not able to delete te file and sometimes im not able to run the app again or run any other app... so i dont know if im not actually closing the app.. or i have to flush memory? hope you can help me again...

davyp
Offline
Joined: 2007-01-03

It is quite possible that the default behavior of the "close" button just moves the application
into the background rather than killing it completely. It is also possible that perhaps the graphical
interface has already disappeared, but that some other thread is still active which leaves the VM running.

You can check in Settings -> Memory whether there is still an application active. Or you could
use some other process explorer like this one to see whether the VM is still running in the
background: http://madebits.com/tools/pocketpc-process-explorer.php

Davy

orlandobarrera
Offline
Joined: 2010-03-08

hehe... thats exactly whats happening... the close button just close the window but it dont kill the applicaction, i have to go to stop it from the running application wndow...I try adding a WindowListener event which calls System.exit(0) when the window is closing, but it dont seems to work...

m4nti5
Offline
Joined: 2010-04-12

Hi, try with this:

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
System.exit(0);
}
}

In the window that is suppose to close the aplication, it worked for me

coder119
Offline
Joined: 2010-03-10

Hi Orlando,

add

-Xopt:stdioPrefix=outputPathName

to your options string (before -cp), where outputPathName is the name where you want the console logs dumped.

This will create ERR, IN and OUT files. Click on ERR to view your exception.

orlandobarrera
Offline
Joined: 2010-03-08

hey thx very much.. now i can see the output console, but the main problem still exist..

Ive tried several differente ways of packing the classes, in a zip file, deploying the .jar obtained after compiling, but i still get the ClassNotFoundException error.. any suggestions?

davyp
Offline
Joined: 2007-01-03

If you add a classpath to the command line, make sure to specify the full path starting from the
root, rather than a relative path. In Windows Mobile there is no equivalent of "current working
directory" so every directory has to be specified from the root.

So if you use the class files directly (without packaging them into a jar) and you don't specify a
class path, cvm.exe assumes they are located in the root. So an easy way to test if this is the
problem, is to copy your class files to the root of your device and see if that works.

Davy