Android Open Source - Sensors2OSC Osc Communication






From Project

Back to project page Sensors2OSC.

License

The source code is released under:

Author: Thomas Mayer <thomas@residuum.org> Antonio Deusany de Carvalho Junior Copyright (c) 2014 Thomas Mayer, Antonio Deusany de Carvalho Junior Permission is hereby granted, free of charge, to any...

If you think the Android project Sensors2OSC listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.sensors2.osc.communication;
//from  ww  w . jav a 2 s. co m
/**
 * Created by thomas on 10.11.14.
 */import android.os.AsyncTask;

import com.illposed.osc.OSCMessage;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by thomas on 19.09.14.
 */
public class OscCommunication extends AsyncTask<String, Void, Boolean> {

  private final OscConfiguration operation;

  public OscCommunication(OscConfiguration operation) {
    this.operation = operation;
  }

  @Override
  protected Boolean doInBackground(String... strings) {
    if (this.operation.getOscPort() == null) {
      return false;
    }
    List<Object> changes = new ArrayList<Object>();
    changes.add(strings[1]);
    try {
      OSCMessage message = new OSCMessage("/" + strings[0], changes);
      this.operation.getOscPort().send(message);
    } catch (Exception e) {
      return false;
    }
    return true;
  }
}




Java Source Code List

org.sensors2.osc.ApplicationTest.java
org.sensors2.osc.activities.AboutActivity.java
org.sensors2.osc.activities.SettingsActivity.java
org.sensors2.osc.activities.StartUpActivity.java
org.sensors2.osc.communication.OscCommunication.java
org.sensors2.osc.communication.OscConfiguration.java
org.sensors2.osc.communication.OscDispatcher.java
org.sensors2.osc.communication.SensorConfiguration.java
org.sensors2.osc.fragments.SensorFragment.java
org.sensors2.osc.fragments.SensorGroupFragment.java
org.sensors2.osc.sensors.Parameters.java
org.sensors2.osc.sensors.Settings.java