Hi Gary,
So then you have four parts I guess.
Detect gestures, send them to laptop, receive them on laptop and act on them.
You need an app that gets the gestures and turns them into commands on the tablet and an application on the laptop to display an image and listen for commands. I think wifi is probably the easiest way to send commands to the laptop.
This isn't all there is to it, but this is one way to make a two way client from Android:
- Code: Select all
public String sendString(String output) {
String s = output;
Socket socket = null;
DataOutputStream dataOutputStream = null;
DataInputStream dataInputStream = null;
try { //192.168.0.2 10.0.2.2
socket = new Socket("192.168.0.2", 8888);
dataOutputStream = new DataOutputStream(socket.getOutputStream());
dataInputStream = new DataInputStream(socket.getInputStream());
byte[] b = s.getBytes("UTF8");
dataOutputStream.write(b, 0, b.length);
byte[] d = new byte[1024];
int n = dataInputStream.read(d);
int i = 0;
s = "";
while (i<n) {
s = s + (char) d[i];
i++;
}//while
} catch (UnknownHostException e) {
s = e.getMessage();
} catch (IOException e) {
s = e.getMessage();
}//catches
finally {
if (socket != null) {
try {
socket.close();
} catch (IOException e) {
s = e.getMessage();
}//catch
}//if
if (dataOutputStream != null) {
try {
dataOutputStream.close();
} catch (IOException e) {
s = e.getMessage();
}//catch
}//if
if (dataInputStream != null) {
try {
dataInputStream.close();
} catch (IOException e) {
s = e.getMessage();
}//catch
}//if
}//finally
return s;
}//sendstring
Hope this helps.
Phyll