ofxPd in Android Studio

Hi Everyone,

I was asked to build an Android Project with both ofxGUI and ofxPd in order to create a button that sends some information to a button embedded in a Pd patch.
I created a project using ProjectGenerator and put it in /addons/ofxPd as suggested in: https://github.com/danomatika/ofxPd.

I then built my project using the command terminal. I invoked the command GCC_VERSION=4.9 make AndroidDebug and seemed work. I noticed this kind of warning:

cc1: warning: command line option '-std=c++1y' is valid for C++/ObjC++ but not for C
/Librerie/openFrameworks/addons/ofxPd/libs/libpd/pure-data/src/x_text.c: In function 'textbuf_free':
/Librerie/openFrameworks/addons/ofxPd/libs/libpd/pure-data/src/x_text.c:203:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     while (x2 = pd_findbyclass(gensym("#A"), text_define_class))
     ^
/Librerie/openFrameworks/addons/ofxPd/libs/libpd/pure-data/src/x_text.c: In function 'text_nthline':
/Librerie/openFrameworks/addons/ofxPd/libs/libpd/pure-data/src/x_text.c:215:30: warning: unused variable 'k' [-Wunused-variable]
             int j = i, outc, k;

Finally, I got this result:

cd "/Librerie/openFrameworks/addons/ofxPd/pd_build"; \
	if [ -d "bin/data" ]; then \
		mkdir -p res/raw; \
		rm res/raw/pd_buildresources.zip; \
		cd bin/data; \
		if [ "darwin-x86_64" = "windows" ]; then \
			echo "Windows Platform. Running Zip..."; \
			cmd //c ..\\..\\..\\..\\..\\libs\\openFrameworksCompiled\\project\\android\\windows\\zip -r ../../res/raw/pd_buildresources.zip * && exit; \
		else \
			zip -r ../../res/raw/pd_buildresources.zip *; \
		fi; \
		cd ../..; \
	fi
rm: res/raw/pd_buildresources.zip: No such file or directory
	zip warning: name not matched: *

zip error: Nothing to do! (try: zip -r ../../res/raw/pd_buildresources.zip . -i *)
copying debugging binaries for armv7
create gdb.setup for armeabi-v7a
creating Android.mk and Application.mk
#@echo updating ofAndroidLib project
#@cd /Librerie/openFrameworks/addons/ofxAndroid/ofAndroidLib; \
	#if [ "darwin-x86_64" = "windows" ]; then \
	#	cmd //c /Users/Boggiz/Library/Android/sdk/platforms/tools/android.bat update project --target android-21 --path .; \
	#else \
	#	/Users/Boggiz/Library/Android/sdk/platforms/tools/android update project --target android-21 --path .; \
	#fi
#@echo updating current project
#@cd /Librerie/openFrameworks/addons/ofxPd/pd_build; \
	#if [ "darwin-x86_64" = "windows" ]; then \
	#	cmd //c /Users/Boggiz/Library/Android/sdk/platforms/tools/android.bat update project --target android-21 --path .; \
	#else \
	#	/Users/Boggiz/Library/Android/sdk/platforms/tools/android update project --target android-21 --path .; \
	#fi

and when I try to import it in Android Studio as I imported an existing Android project such as androidEmptyExample, for instance, seems all the main files are missing.

Could someone provide some help to understand what’s wrong?
So sorry but I just started to be acquainted with this world and sometimes I struggle a bit.

Thank you!
mattia

1 Like

Hey @mpateraau

Were you able to build ofxPd example on Android Studio?
Much thanks.