I'm building an application with my team for a robot car to let it drive controlled by a mobile device. It works perfectly on my phone, but now that I've ported the app to Android Wear, the thread that lets me connect to a server on my Raspberry Pi doesn't work. Is there a way to get this thread working?
Code:
public class SocketConnect {
static DataOutputStream dOut;
static Socket socket;
public static void connect() {
System.out.println("Got to Connect");
new Thread() {
public void run() {
try {
socket = new Socket("192.168.2.9", 8899);
System.out.println("Trying at 2.9");
dOut = new DataOutputStream(socket.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
}.start();
}
....further code
Logcat error: http://pastebin.com/0BtF27p8 (couldn't get it to format nice in the editor)