Skip to main content

getRemoteDevice error

1 reply [Last post]
Joined: 2009-07-03

At this moment i have the following code:


public void startConnectie(){

try {
LocalDevice lokaal = LocalDevice.getLocalDevice();
String adres = lokaal.getBluetoothAddress();
String naam = lokaal.getFriendlyName();

RemoteDevice afstand = RemoteDevice.getRemoteDevice(Connection conn);

String afstandAdres = afstand.getBluetoothAddress();
String afstandNaam = afstand.getFriendlyName(true);


} catch(Exception e){
System.out.println("Error: " + e);
} finally {
System.out.println("Bluetooth gestart");



But the line RemoteDevice afstand = RemoteDevice.getRemoteDevice(Connection conn); gives the following error:


getRemoteDevice( in javax.bluetooth.RemoteDevice cannot be applied to (Connection)

cannot find symbol
symbol: variable Connection
location: class powerpointafstandbediening.Main

')' expected

not a statement



I don't know where to start to fix this problem.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-15

You have provided the variable "conn"'s type "Connection" in the method call.
Make the line read:

RemoteDevice afstand = RemoteDevice.getRemoteDevice(conn);