Hi,
I want to create an mobile application which will be able to send a file to other mobile via Bluetooth.
Can anybody help me in this issue. If possible give me the code.
Thanks,
Hi,
I want to create an mobile application which will be able to send a file to other mobile via Bluetooth.
Can anybody help me in this issue. If possible give me the code.
Thanks,
You can do this using Bluetooth OBEX.
Bluetooth OBEX is Object Exchange protocol over RFCOMM. RFCOMM is protocol over L2CAP. L2CAP is protocol over actual Bluetooth technology.
You can use JSR 82 Java APIs for Bluetooth.
But OBEX feature of JSR 82 is not recommended since it is buggy in many phones. You should code your own OBEX over RFCOMM. But still you can go with OBEX feature of JSR 82 if your phone has no bug with it.
Use OBEX PUT request, set headers NAME, TYPE and LENGTH and then send file contents.
Search this forum Wiki for some examples.
maruffaiz, you do not like to search (or code) on your own, do you? Does this help?
By the way, if you are new to J2ME, MIDlets and Bluetooth, I recommend to start with a book or tutorials rather than code examples as you will have to debug a lot on your own. There are a lot of bugs, tweaks and lessons to be learnt. Bluetooth is complicated. I do not have a good J2ME book at hand right now, however, start with the references of this one for JSR-82 (perhaps your library has its previous edition) or read at least the PDF coming with the specification. If you like to start with tutorials, continue here…