views:

1454

answers:

5

I just recently learn Java and try to communicate to the device through USB port connection. I've have used C# with OpenNETCF which allows me to send file and retrieve file on the device through USB port; how can I achieve this with java?

I seearch on stackoverflow thread, http://stackoverflow.com/questions/544507/how-to-communicate-with-a-usb-device-under-windows-and-java, the comment made by christoffer is to hack the native code, but I don't quite which native code api that he referred to. RAPI, maybe?

+1  A: 

The only USB API I could find for Windows is here. Seems as if it has limited functionality, but it might suit your needs. A more complete UNIX API is also available.

ETA: Found a link to the official Java USB implementation, but looks like the windows version is still in alpha.

Eric Petroelje
that's awesome!,, thank you.
Bopha
A: 

Download usbcomplete.zip. extract the files, read the manuals, go according to specifications. believe me, it really does the job. try it, if it helps well and good if not contact us. [email protected]

Uhh... no link?
unforgiven3
A: 

The native code API I referred to was the Windows DDK, i.e. the Driver Development Kit. The modern version seem to be called Windows Driver Kit, so google for Windows WDK :) There should be a few C samples on how to communicate with USB devices, and it should be pretty straightforward to write a JNI wrapper from those.

Christoffer
A: 

As a quick thought, you could use JNI, the Java Native Interface. I've never used it myself though.

Beau Martínez
A: 

I found this page that explains how to perform a communication between a microcontroller and a java application: http://javausbapi.blogspot.com/

rocky