Ejemplo n.º 1
0
//--------------------------------------------------------------
void testApp::setup() {

	backColor.set(255, 0, 0);
	value = 0;

	JNIEnv *env = ofGetJNIEnv();
	jclass localClass = env->FindClass("cc/openframeworks/androidUiExample/OFActivity");
	javaClass = (jclass) env->NewGlobalRef(localClass);
	if (!javaClass) {
		ofLog() << "javaClass not found!" << endl;
	}

	javaObject = ofGetOFActivityObject();
	javaObject = (jobject) env->NewGlobalRef(javaObject);
	if (!javaObject) {
		ofLog() << "javaObject not found!" << endl;
	}

	outputstr = "";

	player.loadMovie("hands.mp4");
	player.play();
}
Ejemplo n.º 2
0
void ofxAndroidNotifyLoadPercent(float percent){
	jobject activity = ofGetOFActivityObject();
	jclass activityClass = ofGetJNIEnv()->FindClass("cc/openframeworks/OFActivity");
	jmethodID onLoadPercent = ofGetJNIEnv()->GetMethodID(activityClass,"onLoadPercent","(F)V");
	ofGetJNIEnv()->CallVoidMethod(activity,onLoadPercent,(jfloat)percent);
}