views:

323

answers:

3

I am making a j2me application to send an image (taken from a camera) to a PC for further processing. Can I send it over bluetooth using ftp to the pc ?

A: 

Probably not FTP, but you'll want to take a look at JSR-82, the Java Bluetooth APIs. Tutorials are available at that site.

Dean J
While sending files from the pc to any mobile device using bluetooth, the dialog box which shows up mentions FTP. How do I implement the same in J2ME while send files from a mobile device to the pc
Manish Mathai
+1  A: 

I don't know for FTP too, but I used OBEX and avetanaOBEX implementation for transferring files.

Pavel Alexeev
+1  A: 

If you use JSR-82, you can connect a mobile and PC using Bluetooth and send/receive using input/output streams for the wireless transfer, and link those streams to reading and writing your files.

The J2ME GCF supports Bluetooth using URLs such as btspp:// and btl2cap:// URLs to open connections. There's a good introduction on Bluetooth programming here. Or even better, there's a tutorial on using OBEX for transferring images here.

Bear in mind, to do Bluetooth on a desktop PC (in Java SE), you will need a JSR-82 implementation for the desktop to interface with your Bluetooth chip - you can use something like Bluecove (free) or Avetana (non-free).

David Johnson
Why can't JSR-82 suffice for interacting with the desktop bluetooth chip, just as it does for the mobile bluetooth chip?
The Machine
The point is that Sun Microsystems does not implement JSR-82 for Java SE, so it's simply not present in the Standard Edition JRE or JDK. JSR-82 in J2ME is implemented only on handsets, where in the Java ME SDK the emulator does not provide any 'real' hardware interface with a desktop Bluetooth chip. That's why you need a third-party implementation such as those I listed above.
David Johnson