0

Source:

The OPs Working Solution: Sending a File using Bluetooth OBEX Object Push Profile (OPP)

I am trying to use this source in order to test transfer with my app. I have also tried running with variants but the main issue I am getting is that Eclipse wants to initialize this line:

BluetoothDevice device;

to

BluetoothDevice device=null;

In which case then the app gives me an error upon running.

In another case with similar code it will flag a problem with the actual getAddress().

Am I missing something here? Is it because I need to setup a bluetooth connection previously?

Community
  • 1
  • 1
gradytrain
  • 189
  • 1
  • 2
  • 11

1 Answers1

0

Usually BluetoothDevice is available when you find a remote device, Hence you should first use BluetoothAdapter to discover remotedevices then use the code to send data to the remotedevice. you can find a great tutorial in this regard here: (http://www.developer.android.com/guide/topics/connectivity/bluetooth.html‎)

Navid
  • 901
  • 9
  • 20