I have a open android java code called cellbots from GOOGLE, that make a cellphone stream video to a website and the website have javascript that transmit back robot control by pressing arrow keys and then send it to robot by bluetooth.
But it also make the phone work as a hand controller for the robot where it send stepless control by bluetooth.

The code can control 4 types of robots and I use the NXT robot.

I try to see in the code how it listen to commands from the website and how it send stepless commands from the phone.
But I can't understand / find the code.

Can anybody explain to me where it
1: listen to incoming website commands from index.html
2: listen to stepless hand control phone commands
3: transform it to bluetooth commands
4: send it by bluetooth to the NXT robot
and if it is possible to make it listen to stepless commands from the website?

Here is the index.html website code.


HTML Code:
if (evt.keyCode == keyCodes.SPACE)
        else if (evt.keyCode == keyCodes.ARROWUP && prevAction != 'f') {
        } else if (evt.keyCode == keyCodes.ARROWDOWN && prevAction != 'b') {
        } else if (evt.keyCode == keyCodes.ARROWRIGHT && prevAction != 'r') {
        } else if (evt.keyCode == keyCodes.ARROWLEFT && prevAction != 'l') {
    function sendAction(act) {
        prevAction = act;
        sendPut('command.php', act);
    function sendPut(str, content) {
        var xhr = new XMLHttpRequest();
        xhr.open("PUT", "http://" + ipPort + "/" + str);
Here is a WIKI that explain how it can send commands from phone to robot by bluetooth I guess.


I guess it is here it listen for commands from the website but I do not understand exactly where and how.


I guess it is somewhere here it send commands to the robot by bluetooth.