开发者

How can one device determine whether another's Bluetooth is connected, using J2ME?

开发者 https://www.devze.com 2023-03-01 10:03 出处:网络
I am trying to connect two Bluetooth devices using J2ME. Both devices connect successfully and also transfer data very well. If one of the devices has its B开发者_如何学运维luetooth switched off, how

I am trying to connect two Bluetooth devices using J2ME. Both devices connect successfully and also transfer data very well. If one of the devices has its B开发者_如何学运维luetooth switched off, how can the other device know that the connection has been lost?

MIDP= 2.0  
cldc= 1.1


i am currently developing a J2ME game that works over bluetooth, and you could run into two different scenarios, the first being one of the devices falling out of range and failing to deliver data and that can be solved by forcing the communicating devices to send acknowledgments on receiving data, and checking for that every fixed period of time, the second scenario which resembles yours, will cause an Exception, probably an IOException which can be caught and dealt with.

harshad


Hey Hi, You need to run one thread in J2ME application,this thread running after some period of time & this thread needs to check whether Bluetooth connection available for selected Bluetooth or not. Thanks


i am currently developing a J2ME game that works over bluetooth,
and you could run into two different scenarios, the first being one of the devices falling out of range and failing to deliver data and that can be solved by forcing the communicating devices to send acknowledgments on receiving data, and checking for that every fixed period of time, the second scenario which resembles yours, will cause an Exception, probably an IOException which can be caught and dealt with.

0

精彩评论

暂无评论...
验证码 换一张
取 消