Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top