You Are Here:

Community: Developer Discussion Boards

#1 Old MIDlet: Connection bluetooth problem - 2008-11-19, 03:57

Join Date: Nov 2008
Posts: 6
Wulfric
Offline
Registered User
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.
Reply With Quote

#2 Old Re: MIDlet: Connection bluetooth problem - 2008-11-21, 15:36

Join Date: May 2008
Posts: 12
huss81
Offline
Registered User
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...
Reply With Quote

#3 Old Re: MIDlet: Connection bluetooth problem - 2008-11-25, 10:36

Join Date: Nov 2008
Posts: 6
Wulfric
Offline
Registered User
Thanks huss81, I will check it at once... thanks again
Reply With Quote

#4 Old Re: MIDlet: Connection bluetooth problem - 2008-12-18, 08:26

Join Date: Dec 2008
Posts: 4
jprogyog
Offline
Registered User
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.
Reply With Quote

#5 Old 2009-01-23, 15:30

Join Date: Mar 2003
Posts: 2,617
traud
Offline
Super Contributor
Quote:
Originally Posted by Wulfric View Post
UUID is 0x1101
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia