2017-04-25 34 views
0

因此,我试图将seekBar的progressValue发送到使用OSC的服务器。但是,我没有收到服务器端的任何信息。尝试使用OSC/UDP发送seekBar到服务器的progressValue使用OSC/UDP

连接有效,因为我拥有所有注册的单选按钮以及同样有效的玩家注册。任何人都可以检查此代码段并提供一些建议?

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()); 
      } 
     } 
+0

什么样的数据类型是sz?它与服务器上的注册回调是否相同?如果服务器与预期的不匹配,它可能会在服务器上被放弃。 – razong

回答

0

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

相关问题