You guys are completely right!
Rancs, I went and added some permissions, and it compiled immediately. I will edit this answer with my code and permissions in case anyone is searching for a solution in the future.
THANK YOU!
EDIT:
To get OSC messages sent from my android (samsung s5) to osx (macbrook pro running 10.10.4 yosemite), I set these permissions in AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
Then make sure to add the addon to addons.make. Mine says:
ofxAndroid
ofxAccelerometer
ofxOsc
Then, the only thing necessary in the .h file is:
#pragma once
#include "ofMain.h"
#include "ofxAndroid.h"
#include "ofxOsc.h"
#define HOST "XXX.XXX.X.XXX"
#define PORT 12345
class ofApp : public ofxAndroidApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void windowResized(int w, int h);
void touchDown(int x, int y, int id);
void touchMoved(int x, int y, int id);
void touchUp(int x, int y, int id);
void touchDoubleTap(int x, int y, int id);
void touchCancelled(int x, int y, int id);
void swipe(ofxAndroidSwipeDir swipeDir, int id);
void pause();
void stop();
void resume();
void reloadTextures();
bool backPressed();
void okPressed();
void cancelPressed();
ofTrueTypeFont font;
ofxOscSender sender;
};
And then the .cpp file should have this where I left out functions that were not modified from the androidEmptyExample at all:
#include "ofApp.h"
#include <unistd.h>
//--------------------------------------------------------------
void ofApp::setup(){
ofBackground(40, 100, 40);
ofSetFrameRate(60);
// open an outgoing connection to HOST:PORT
sender.setup(HOST, PORT);
}
//--------------------------------------------------------------
void ofApp::draw(){
// display instructions
string buf;
buf = "sending osc messages to" + string(HOST) + ofToString(PORT);
ofDrawBitmapString(buf, 10, 20);
ofDrawBitmapString("move the mouse to send osc message [/mouse/position <x> <y>]", 10, 50);
ofDrawBitmapString("click to send osc message [/mouse/button <button> <\"up\"|\"down\">]", 10, 65);
ofDrawBitmapString("press A to send osc message [/test 1 3.5 hello <time>]", 10, 80);
ofDrawBitmapString("press I to send a (small) image as a osc blob to [/image]", 10, 95);
}
//--------------------------------------------------------------
void ofApp::touchDown(int x, int y, int id){
ofxOscMessage m;
m.setAddress("/mouse/touch");
m.addIntArg(id);
m.addStringArg("down");
sender.sendMessage(m, false);
}
where most of that is just from the ofxOscSenderExample. I modified the receiver example to handle the “/mouse/touch” but that’s about it. It was really simple once I was able to get things compiled. But hopefully this helps someone else who was horribly lost like me sometime in the future.
Thanks for everyone in the community who helped me out.