Skip to main content

getRemoteDevice error

1 reply [Last post]
debiesven
Offline
Joined: 2009-07-03
Points: 0

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);

actieVeld.setText(lokaal.getBluetoothAddress());

} 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(javax.microedition.io.Connection) 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.
sfitzjava
Offline
Joined: 2003-06-15
Points: 0

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

RemoteDevice afstand = RemoteDevice.getRemoteDevice(conn);