Android Open Source - SensOSC Osc Communication






From Project

Back to project page SensOSC.

License

The source code is released under:

Author: Thomas Mayer <thomas@residuum.org> Copyright (c) 2014 Thomas Mayer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation ...

If you think the Android project SensOSC 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.residuum.sensosc;
// w  w w .j a va  2s  .c o m
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.residuum.sensosc.AboutActivity.java
org.residuum.sensosc.ApplicationTest.java
org.residuum.sensosc.ExtendedEditTextPreference.java
org.residuum.sensosc.OscCommunication.java
org.residuum.sensosc.OscConfiguration.java
org.residuum.sensosc.SensorFragment.java
org.residuum.sensosc.SensorGroupFragment.java
org.residuum.sensosc.Sensor.java
org.residuum.sensosc.SettingsActivity.java
org.residuum.sensosc.StartupActivity.java