| Reply | « Previous Thread | Next Thread » |
|
Hi everybody, I have a serious problem and I apreciate if somebody could help me. I developed a MIDlet using Net Beans, this application send a string from a cellular using bluetooth to another cellular phone, in the simulator it works properly, but once in the nokia telephones it doesn´t send anything, the MIDlet run and works good but when I try to send, it send nothing. Testing the midlet in a sony ericsson phone, it works beautiful and send the string as it should do, but I need to use it in nokia phones.
By the way, the MIDlet detects perfectly the bluetooth devices (the problem is when I try to send the string). I´m using javax.bluetooth.*, DataOutputStream, and writechars. ![]() |
|
hi,
I had similar problems as i was developing an application for my N70. I used SPP protocol for communication purposes and DataInputStream and DataOutputStream for receiving/sending data. If you do so, you might have to enforce sending data by flush the streams. The following code snips show my implementation: ..... serialConnection = (StreamConnection)Connector.open(connectionURL); serialInputCh = serialConnection.openDataInputStream(); serialOutputCh = serialConnection.openDataOutputStream(); ...... public void sendByte(int value, boolean flush) throws Exception { try { virtualSerialOutputCh.write(value); if(flush) { virtualSerialOutputCh.flush();/*enforce writing out*/ } ....... } ...... parameter flush is set TRUE when the last byte is sent.. I hope this might help... |
|
Thanks huss81, I will check it at once... thanks again
|
|
Hi Wulfric, huss81,
I m having the same problem. I m writing on port using flush also still it isn't working .I want send int or string from mobile and read on computer. On PC side i m using bluesoeil and comm API to read port. But no data coming I m confused whether mobile is not sending data or my comp. application is not able to read it. ![]() Please help me. Its Urgent. Thanks. |
|
That is the important piece of information.
You should use your own private UUID both on your server and clients. This code worked in emulator because there is only your service. On a mobile phone there are several services, perhaps several ones using 0x1101L. Consequently, this code works with some phones, with others you connect to a complete different service expecting to talk a different protocol. Did that 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… |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| j2se server j2me client bluetooth connection problem | bepolat | Mobile Java Networking & Messaging & Security | 1 | 2007-11-27 16:18 |
| Opening connection to the secure element fails when restarting the midlet. | tfroidcoeur | Near Field Communication | 6 | 2007-08-24 09:38 |
| Bluetooth Connection problem | big_stewartay | Bluetooth Technology | 1 | 2006-02-01 08:14 |
| Error loading midlet on 3650 when bluetooth connection is active | haunts666 | Mobile Java General | 0 | 2003-07-03 00:09 |
| A internet connection problem in the network MIDlet I made for Nokia 7650. | captin | Mobile Java General | 0 | 2002-11-04 00:22 |