Blackberry Bluetooth sample program for communication between two mobile devices

被刻印的时光 ゝ 提交于 2019-12-25 16:44:56

问题


I am a blackberry developer and do want to code to transmit and receive information between two devices using bluetooth .

https://github.com/blackberry/JDE-Samples/tree/master/com/rim/samples/device/bluetooth/bluetoothdemo

I referred this program of bluetooth demo which

  1. Takes info of bluetooth serial ports available in AppScreen and finds if they are supported or not

  2. The SPPScreen java file takes info of bluetooth serial port and connects to serial port whose device id is " Hi there "

This class has got terms like DSR_ON , DSR_OFF , DTR in menu which enables DSR as on, DSR as off and checks DTR status ... which I did not get

This class also includes loopback on and loop back off which is a flag used during receive method.

This class contains method sendData() which sends 1k data and dataReceive() method to receive data, but this method has not been called anywhere as per my knowledge inside the code.

Steps i took before implemeting the code .

The bluetooth does not work on simulator , so I signed and tested on 2 real devices .

I named both the devices (Suppose Device A and Device B) as "Hi there" and paired them manually outside the application .

Then I launched the application on both the devices .

From Device B I selected the option for Listen for connection from menu and on Device A ... I connected to Hi there device then it got connected and then on device A it says

"Type something..." and on device B it says

"Connect external device and then type something..."

So up to this step the program works fine . Now when I type something nothing seems to happen.

So my concern is

  1. Does this code really sends and receives data between the two devices A and B.

  2. If any one gets the whole project code, please explain.


回答1:


Yes it does send text that you type from one bb to another. Letter by letter..



来源:https://stackoverflow.com/questions/16793859/blackberry-bluetooth-sample-program-for-communication-between-two-mobile-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!