尝试使用OSC / UDP查询seekBar的progressValue到服务器

时间:2017-04-25 02:38:09

标签: java android osc

所以,我试图使用OSC将seekBar的progressValue发送到服务器。但是,我没有在服务器端收到任何信息。

连接有效,因为我有所有注册的单选按钮,以及也适用的播放器注册。任何人都可以查看此代码段并提供一些建议吗?

 public void onProgressChanged(SeekBar seekbar, int progressValue,   boolean fromUser) {
      int step = 10;
        //  text = (TextView) findViewById(R.id.text);
        if(seekbar == Size) {
            progressValue = ((int) Math.round(progressValue / step)) * step;

            sz = progressValue;
            Size.setProgress(progressValue);
            text.setText(String.valueOf(progressValue));

            try{
            //This is where the value is being sent to the server    
            sender.send(new OSCMessage("/update_size", sz));
            }catch(Exception E){
                text.setText("Catch 3: "
                        + E.getClass().getName() + ", "
                        + E.getMessage());
            }
        }

1 个答案:

答案 0 :(得分:0)

我必须使用一个数组方法来传递消息中的浮点数或整数。我通过将其作为文本值传递,然后在服务器上解析它来解决这个问题。