You are reading a single comment by @user125066 and its replies. Click here to read the full conversation.
  • Hi Gordon, Thanks for the quick reply. I eventually worked it out. I want to get some data in real time from a Bangle app onto the android screen.

    In Droidscript

    // Connect to Bangle
      puck = app.CreatePuckJS();
      puck.SetOnReceive( readResponse );   // Callback to capture console output from app.
      puck.Scan("Bangle");
    

    The callback function something like :

    function readResponse(data) {
        if ( data.substring(0,1) != '{' ) return;       // ignore non JSON
        d = JSON.parse(data);
      // Do something with the data in array d
    }
    

    In the Bangle app the dat array is sent as a JSON string :

    function btSend(dat) {
      // console.log(JSON.stringify(dat));         // transmit the data
      Bluetooth.println(JSON.stringify(dat));         // transmit the data
    }
    

    It will all be published in the 'GPS Adventure Sports II' Bangle app soon.

About

Avatar for user125066 @user125066 started